Reason for existence of single parts vs. multipart layers

gis-principlemultipartsinglepartvector

Vector layers can consist of single part or multipart layers. What is the reason for creating separate formats for that?

It is perfectly possible to create a multipart layer and still create just one geomtry part per feature. So why the hassle to have a special singlepart type for vector layers? It is often annoying when you have a singlepart layer and want e.g. to merge features that you have to create a new layer for that. So there must be an advantage of having layers that restrict features to be singelpart only.

The question is a general GIS principle question, not software specific. Still, if there is a need for a specific software environment for the question to be specific enough, I'm working mostly in QGIS, using Geopackage layers. But I am interested in a general answer about why two separate types of let's say polygon layers do have to exist.

I am aware of the differences between single part and multipart layers, so the question is not about that but the reason why this has to be represented by two incompatible types of layers.

Best Answer

Firstly the single geometry objects have a simplicity of representation which takes up less storage and processing, and its likely they cover enough of the use cases to be worth implementing separately.

I suspect its also about simplicity of constraints, and that its easier to specify something as having POINT geometry, and therefore knowing each feature is a single point, than specifying something has having MULTIPOINT geometry with exactly one point per feature.

That means its easier for software that can only work on POINT geometries, and reject anything MULTIPOINT (even if all the MULTIPOINTS are singular), leaving any casting to POINT to the user.

I've just been reading an OGC standards doc that gives a list of valid MULTIPOLYGONs, one of which is a single ring so would also form a valid POLYGON geometry. So yes, in theory all your features could be MULTI and all that might happen is some software may refuse to work with it unless you cast it to single geometries.

Even if all valid geometries were MULTI geometries, there's still the necessity to define the single geometries in order to build the MULTI geometries, and it seems the decision was made to include the single geometries as as important as the MULTI ones. This may be related to computer science's practice of defining smallest atomic things and then differentiating between an atom and a list of one atom, and is related to the object structure diagrams you'll find in the standards document. In most programming languages this is true.

All the above is basically speculation though, I've not found anything about why single and multi geometries are allowed when a multi geometry of size one would cover all single geometry formation cases.

Related Question