[gdal-dev] shapefile polygon/multipolygon ordering

mccorb mccorb at cox.net
Fri Nov 14 08:26:07 PST 2014

I used GDAL to create a new shapefile of polygons. 

The polygons (multi-polygons) were land areas. Some of the land areas had
holes defined which were lakes within the land area. Within the lakes there
were some islands of land...so I had a polygon with a hole with more

When I created the shapefile and saved it, it re-ordered the polygons so
that all the land polygons preceded all the hole polygons (within a single
multi-polygon). Although it worked ok for the computations I was doing, it
drew the polygons in the wrong order so that it drew the main land polygon,
then the islands, then the lakes which then obscured the islands.

I don't really know what the shapefile specification says about this but it
seems as though whoever did the shapefile writer for GDAL actually had to
expend extra effort to rearrange the polygons in this manner. 

Two questions:
1. Is it within the shapefile specification to have polygons that have holes
that have polygons?
2. Does GDAL provide any options to coerce it to not re-order the polygons?


View this message in context: http://osgeo-org.1560.x6.nabble.com/shapefile-polygon-multipolygon-ordering-tp5173074.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.

More information about the gdal-dev mailing list