[gdal-dev] Adding multipolygons to an existing geometry collection
danotchki at gmail.com
Wed Mar 24 12:11:42 EDT 2010
I hope you will be able to help me. I'm stuck on a problem.
I'm trying to reconstruct within my Python script polygons from a shapefile
that belong together.
So I naturally perfomed:
geom_tmp = ogr.CreateGeometryFromWkb(ftr.GetGeometryRef().ExportToWkb())
However this works only when the geometry to add is of type POLYGON. This
_doesn't_ work with type MULTIPOLYGON (exit code 3).
My question: is there a way to add MULTIPOLYGONs to an existing Geometry?
What I don't understand is that when CreateGeometryFromWkb returns a
MULTIPOLYGON it actually returns a GEOMETRY instead of a GEOMETRYCOLLECTION,
thus preventing looping on each individual geometry with GetNumGeometries.
Would there be a way to cast the polygon to a multipolygon?
Help very much appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev