Skip to content

Return dimension-appropriate empty geometries from overlay operations#696

Merged
peterstace merged 1 commit intomasterfrom
dimension_appropriate_empty_geometries
Feb 12, 2026
Merged

Return dimension-appropriate empty geometries from overlay operations#696
peterstace merged 1 commit intomasterfrom
dimension_appropriate_empty_geometries

Conversation

@peterstace
Copy link
Owner

@peterstace peterstace commented Feb 12, 2026

Description

Change GeometryCollection.Dimension() to return -1 for empty geometry collections (previously 0), distinguishing them from empty Points. This is consistent with GEOS.

Update overlay operations (Union, Intersection, Difference, SymmetricDifference) to return empty geometries matching the expected result dimension (e.g. POLYGON EMPTY instead of GEOMETRYCOLLECTION EMPTY).

Check List

Have you:

  • Added unit tests? Yes.

  • Add cmprefimpl tests? (if appropriate?) N/A

  • Updated release notes? (if appropriate?) Yes.

  • Updated the README.md (if new functionality is added?) N/A

Fixes

Change `GeometryCollection.Dimension()` to return -1 for empty geometry
collections (previously 0), distinguishing them from empty Points. This
is consistent with GEOS.

Update overlay operations (Union, Intersection, Difference,
SymmetricDifference) to return empty geometries matching the expected
result dimension (e.g. POLYGON EMPTY instead of GEOMETRYCOLLECTION
EMPTY).
@peterstace peterstace self-assigned this Feb 12, 2026
@peterstace peterstace merged commit cedb534 into master Feb 12, 2026
1 check passed
@peterstace peterstace deleted the dimension_appropriate_empty_geometries branch February 12, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant