0

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.

6
  • simplefeature standard?
    – Ian Turton
    Commented Sep 12, 2023 at 13:36
  • 1
    Yes @IanTurton but why does the standard define single geometries when a MULTI geometry of size 1 is equivalent? My thoughts below, but I've not found anything definitive.
    – Spacedman
    Commented Sep 12, 2023 at 17:58
  • 1
    It doesn't "have to be" represented by two incompatible types of layers, as evidenced by the shapefile spec, but that's what was chosen. Having multipoint different than point makes sense, because multipoints have an envelope. The distinction on polyline and polygon is far less clear.
    – Vince
    Commented Sep 12, 2023 at 19:35
  • 1
    To me, as a user, it is the same as why bother between points and polygons while we could just use a geometry column. I expect to work with simple entities and I want to ensure that I store only simple entities. If a tool/function returns a collection, I have to take the extra step to ensure/convert the result to simple entities. If simple/multi were the same datatype, it would be very easy to miss a simplicity validation as my code wouldn't blow up. For example, doing an intersection and indexing the result: the index would silently cover 2 far away parts, making it potentially useless.
    – JGH
    Commented Sep 12, 2023 at 20:06
  • 2
    And as a programmer, I am fairly sure that the overhead for going through every part of the multi collection - even if just one - isn't free.
    – JGH
    Commented Sep 12, 2023 at 20:08

1 Answer 1

2

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.

1
  • Thanks for your thoughts, +1. Will see if there is another answer with an authoritative reply to substantiate your assumptions.
    – Babel
    Commented Sep 12, 2023 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.