Shapefiles – Determine if Polygon Type is Multipolygon

polygonshapefile

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.

Best 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 ;-)