[FWTools] return a features geometry
Frank Warmerdam
warmerdam at pobox.com
Thu Sep 11 15:24:20 EDT 2008
Travis Kirstine wrote:
> Is there a method to return all (polygon) feature geometries as a
> list using python?
>
> layer = shp.GetLayerByName(layerName)
> feature = layer.GetNextFeature()
> polyGeom = feature.GetGeometryRef()
> exteriorRing = polyGeom.GetGeometryRef(0)
> print exteriorRing.GetX(0), exteriorRing.GetY(0) # return only one coord pair
Travis,
No, there isn't but you could easily construct such a method in Python
out of the existing primitives.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the FWTools
mailing list