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

False positive intersections? #20

Closed
pm0u opened this issue Sep 24, 2024 · 2 comments
Closed

False positive intersections? #20

pm0u opened this issue Sep 24, 2024 · 2 comments

Comments

@pm0u
Copy link

pm0u commented Sep 24, 2024

Tracking down Turfjs/turf#2707

I traced it back to this lib.

Minimal repro: https://codesandbox.io/p/sandbox/turfjs-7-1-0-s8x273

This uses the same export hack that TurfJS uses, if that could possibly be related to the issue. I don't believe this is relevant, I tested a direct import with types ignored.

line is just some real world data that I happen to find an issue with. The original polygon that i noticed it with was much more complex, but I found the issue persisted with simplification of the polygon. Additionally, I removed ~2000 coordinates from the line to arrive at this where commenting some coords that definitely do not reside in the polygon will change the intersection result

@pm0u
Copy link
Author

pm0u commented Sep 24, 2024

Stripped it back even further and removed z coord. Commenting any coord line will change the intersection result currently, it's down to 6 coordinates in the sample line.

@pm0u
Copy link
Author

pm0u commented Sep 24, 2024

Closing - debugger tool was helpful (thanks!). This was due to self intersections.

So, not a bug with this library but as noted in the linked turf issue I do believe this represents an unannounced breaking change to booleanIntersects as previously I don't think the algorithm used would have reported (or even checked?) self intersections.

@pm0u pm0u closed this as completed Sep 24, 2024
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

No branches or pull requests

1 participant