Saturday, 26 May 2018

Shapefiles - polygon type - is it in fact multipolygon?


I'm wondering about the ESRI shapefile with shape type 5.


When reading the spec I see that "A polygon may contain multiple outer rings.". Does this mean that these outer rings must be combined to form a polygon or does it mean that it is in fact a "MultiPolygon" type? So that multiple polygons can be in one entry?


EDIT: Background => I'm writing a reader for shapefiles.



Answer




From the GDAL page for the Shapefile driver:



SHPT_POLYGON shapefiles, reported as layers of type wkbPolygon, but depending on the number of parts of each geometry, the actual type can be either OGRPolygon or OGRMultiPolygon.



So the answer to your question is YES ;-)


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...