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

Intersection robustness failure #300

Closed
dbaston opened this issue Aug 21, 2018 · 5 comments
Closed

Intersection robustness failure #300

dbaston opened this issue Aug 21, 2018 · 5 comments

Comments

@dbaston
Copy link
Contributor

dbaston commented Aug 21, 2018

An intersection operation with floating precision fails between the valid inputs below. Extracted from r-spatial/sf#794

Edit: removed WKT dump

@dbaston
Copy link
Contributor Author

dbaston commented Aug 21, 2018

Actually, here is an attached XML from TestBuilder. GitHub made me change the extension to .txt.
300.txt

@dr-jts
Copy link
Contributor

dr-jts commented Aug 22, 2018

Those geometries are riddled with classic robustness-failure issues. Lots of nearly coincident points, and at least one place where the boundary of a geometry has a "narrow Z" pattern. So not surprising that they fail on overlay.

Because of the linework pathologies (in particular the narrow Z), likely the snapping heuristic fails as well. And reducing precision is likely to introduce invalidity (i.e. due to the Z collapsing).

As always, snap-rounding would probably solve these problems.

@dr-jts
Copy link
Contributor

dr-jts commented Sep 21, 2019

Update: snap-rounding overlay does allow this intersection operation to complete successfully.

First, here's an image of the highly "unclean" linework on the border of the two input polygons (note: this is using the TestBuilder Reveal Topology mode - in actuality the gaps/overlaps are on the order of 1e-8 and hence almost invisible)

image

Executing the intersection using snap-rounding overlay with a grid size of 1e-5 gives the output shown below (black lines). The output is a MultiLineString (which contains gaps, as expected given the overlaps along the boundary).

image

@gvsharma
Copy link

gvsharma commented Feb 2, 2023

interesting , no response from anyone?

@dr-jts
Copy link
Contributor

dr-jts commented Feb 2, 2023

This was fixed by the introduction of OverlayNG in #599.

@dr-jts dr-jts closed this as completed Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants