Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overlay heuristic for GeometryCollections with empty elements #1229

Merged
merged 13 commits into from
Jan 17, 2025

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented Jan 15, 2025

This fixes the behaviour of the "combine disjoint" overlay heuristic for GeometryCollections containing empty elements (which are now removed).

Fixes #1224

(Note: part of #1224 requires #1136 to be fixed as well).

The PR also:

  • centralizes overlay heuristic logic in HeuristicOverlay (moving code from Geometry)
  • modularizes the HeuristicOverlay code
  • improves HeuristicOverlay semantics to return empty results as an empty typed atomic geometry instead of an empty GeometryCollection (this matches OverlayNG)
  • removes unnecessary dependencies on HeuristicOverlay (by calling OverlayNGRobust directly where it is known the heuristics do not apply)
  • fixes XMLTester to correctly handle operation A & B argument switching

@dr-jts dr-jts added the Enhancement New feature or feature improvement. label Jan 15, 2025
src/geom/HeuristicOverlay.cpp Outdated Show resolved Hide resolved
src/geom/HeuristicOverlay.cpp Outdated Show resolved Hide resolved
src/geom/HeuristicOverlay.cpp Outdated Show resolved Hide resolved
tests/xmltester/XMLTester.cpp Outdated Show resolved Hide resolved
@dr-jts dr-jts merged commit b6c1b59 into libgeos:main Jan 17, 2025
28 checks passed
@dr-jts dr-jts deleted the fix-overlay-gc-with-empty branch January 17, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or feature improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Union Operations returns collections containing empty elements
2 participants