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 TopologyPreservingSimplifier to avoid jumping components #1096

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented Nov 5, 2024

Fix TaggedLineString to return a valid component point for simplified lines. This fixes some cases which can cause TopologyPreservingSimplifier to "jump" components and create invalid geometry.

No unit tests are provided, since it has not been possible to create a simple reproducer. The issue was seen in test case 19 from libgeos/geos#1180. If this is simplified with tolerance 0.01 a hole is left outside the simplified shell.

network-as-polygon-edgecase-19.txt
image

One thing preventing creating a simple test case is that TopologyPreservingSimplifier is non-deterministic in the order of simplifying rings. It would be good to change to a deterministic evaluation order, to allow simpler test cases and provide consistency across JTS derivatives such as GEOS.

@dr-jts dr-jts merged commit 917e1da into locationtech:master Nov 5, 2024
2 checks passed
@dr-jts dr-jts deleted the fix-tp-simplifier branch November 5, 2024 22:25
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