Changeset 908
- Timestamp:
- 10/13/07 10:55:35
- Files:
-
- PCL/trunk/PCL-Core/cartography/data/feature.py (modified) (1 diff)
- PCL/trunk/PCL-Core/tests/DataFeature.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
PCL/trunk/PCL-Core/cartography/data/feature.py
r544 r908 269 269 'srs': str(b.srs), 'properties': dict(prop_items)} 270 270 271 def _provideGeoInterface(self): 272 info = self.info() 273 return { 274 'id': info['id'], 275 'properties': info['properties'], 276 'geometry': self.properties[self.defaultgeometry().name].__geo_interface__ 277 } 278 __geo_interface__ = property(_provideGeoInterface) 279 PCL/trunk/PCL-Core/tests/DataFeature.txt
r544 r908 68 68 >>> source.addfeature(ExampleFeature('tf:4', name='Union', the_geom=union, center=union.centroid())) 69 69 70 Geo interface provision 71 ----------------------- 72 73 >>> f = ExampleFeature('tf:1', name='A Polygon', the_geom=tri_a, center=tri_a.centroid()) 74 >>> f.__geo_interface__ 75 {'geometry': {'type': 'Polygon', 'coordinates': (((-1.0, 50.5, 1.7000000000000002e-308), (-0.5, 51.200000000000003, 1.7000000000000002e-308), (0.29999999999999999, 50.899999999999999, 1.7000000000000002e-308), (-1.0, 50.5, 1.7000000000000002e-308)),)}, 'id': 'tf:1', 'properties': {'name': 'A Polygon'}} 76
