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

Defaulting to ignoreSelfIntersections: false changes behavior of a number of Turf methods in v7 #2722

Open
pm0u opened this issue Sep 24, 2024 · 5 comments

Comments

@pm0u
Copy link

pm0u commented Sep 24, 2024

Introduced in #2033

Defaulting to include self intersections in the @turf/line-intersect module has introduced breaking changes to a number of consuming modules as well as creating unexpected behaviors within those modules. Previously, I believe this algorithm did not / was not able to check for self intersections however now it does by default.

Examples

6.5.0
7.1.0 (includes sweepline module example)

Related issues

#2707
#2700
#2633
#2585

@pm0u
Copy link
Author

pm0u commented Sep 24, 2024

While booleanIntersects (and others) can be worked around by adding an explicit { ignoreSelfIntersections: true }, some methods such as booleanCrosses do not expose this option and do not explicitly exclude self intersections themselves essentially rendering them broken (I do not believe the intention of crosses would be that when comparing two geometries, return true if one of the geometries crosses itself)

@smallsaucepan
Copy link
Member

Thanks for pulling this together @pm0u. We're taking a look now.

@pm0u
Copy link
Author

pm0u commented Sep 30, 2024

@smallsaucepan - thanks, happy to help with a PR if desired but I think where it stands now there are still some decisions to be made around how to handle this change before I could know where to go with that. let me know if I can help

@smallsaucepan
Copy link
Member

Hi @pm0u. The current plan is to revert Turf to the ignore behaviour of 6.5.0 - across the board. These look to be undocumented breaking changes that we should fix as soon as possible.

Have created discussion #2728 to work through the details of a PR. Are you in a position to join in over there?

@smallsaucepan
Copy link
Member

Hi @pm0u. Looks like discussion over at #2728 has concluded. Maintainers have agreed we should revert ignoreSelfIntersections behaviour to 6.5.0. Which I think means setting ignoreSelfIntersections default value to true wherever it appears in the current API.

Would you like to prepare a PR for this?

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

2 participants