[gdal-dev] shapefile polygon/multipolygon ordering

David Strip gdal at stripfamily.net
Fri Nov 14 17:47:12 PST 2014


On 11/14/2014 9:26 AM, mccorb wrote:
> 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?
>
> thanks
>

Yes, polygons can have holes.
I have no idea about question 2, but in fact this raises a different
question:
Does the shapefile spec say anything about rendering order?

My quick read of the ESRI whitepaper suggests the answer is no.

In general, I would suggest the solution is to have one shapefile for
land masses, one for lakes, and one for islands. Rendering order can
then be controlled by application. The one drawback of this approach is
islands with lakes on them, which is a bit pathological, but does occur.
In his book "Maphead", Ken Jennings (yes, the Jeopardy guy) cites some
place where the nesting of water/island/water... goes three layers deep.


More information about the gdal-dev mailing list