Skip to content

Add CoverageCleaner#1126

Merged
dr-jts merged 19 commits intolocationtech:masterfrom
dr-jts:add-coverage-clean
Apr 30, 2025
Merged

Add CoverageCleaner#1126
dr-jts merged 19 commits intolocationtech:masterfrom
dr-jts:add-coverage-clean

Conversation

@dr-jts
Copy link
Contributor

@dr-jts dr-jts commented Apr 28, 2025

Adds a CoverageCleaner class to clean a set of polygonal geometries to form a valid polygonal coverage.

The input is an array of valid Polygon or MultiPolygon geometries which may contain topological errors such as overlaps and gaps. Empty or non-polygonal inputs are removed.

  • Linework is snapped together to eliminate small discrepancies, improve the robustness of the operation, and prevent long narrow gaps from forming spikes
  • Overlaps are merged with an adjacent polygon, according to a merge strategy. Several merge strategies are available; the default is to merge to the adjacent polygon with longest shared border.
  • Gaps narrower than a given width are filled and merged with an adjacent polygon.

The output is an array of cleaned polygonal geometries corresponding to the input and forming a valid polygonal coverage (according to the existing CoverageValidator).

image

See also blog post.

@dr-jts dr-jts force-pushed the add-coverage-clean branch from ae121c9 to 83b6a43 Compare April 30, 2025 01:09
@dr-jts dr-jts merged commit e7cd7cf into locationtech:master Apr 30, 2025
2 checks passed
@dr-jts dr-jts deleted the add-coverage-clean branch April 30, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant