You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The intersection of a geometrycollection with 4 polygons with a Polygon that overlaps with all four polygons in the collection results in one Polygon. Is this correct?
Issue created based on a slightly more complicated case posted on stackoverflow.
Well, that depends on the semantics of handling overlay of GeometryCollections. At the moment it uses "union semantics" - the overlay result is the result of unioning the inputs first. Given this, the result makes sense.
The alternative is "collection semantics", where the result is the collection of the overlay applied to each collection element separately. If this behaviour is desired it's fairly easy to build externally.
Which one is preferable is likely a matter of preference (or use case).
It's worth noting that the in-progress support for GeometryCollections and spatial predicates will also use union semantics.
OK, I expected the "collection semantics", but it will indeed be a matter of preference/use case you are thinking about.
At first sight, I think it is even easier to apply "union semantics" if "collection semantics" would be the default as you just need to call union() on the input collection(s) while for the other way around you need to write a loop and collect everything again?
For consistency, it does sound logical that the same semantics are used for overlays and spatial predicates, whatever is used.
theroggy
changed the title
Wrong result for intersection of Geometrycollection with polygon?
Unexpected result for intersection of Geometrycollection with polygon?
Mar 27, 2024
The intersection of a geometrycollection with 4 polygons with a Polygon that overlaps with all four polygons in the collection results in one Polygon. Is this correct?
Issue created based on a slightly more complicated case posted on stackoverflow.
The text was updated successfully, but these errors were encountered: