-
Notifications
You must be signed in to change notification settings - Fork 954
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
Issue with turf.difference behavior between Turf.js v5.16 and v6.5 (and recent versions) #2836
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I’ve encountered a discrepancy in the behavior of the turf.difference function between Turf.js versions 5.16 and 6.5.
In version 5.16, using turf.difference to subtract holes (multipolygon) from a world polygon works as expected, producing the correct result. However, when I update to version 6.5, the output is incorrect or differs from the expected result.
Steps to Reproduce:
Use the following world polygon as the outer boundary:
Use the multipolygon as the holes:
Apply turf.difference to subtract each hole from the world polygon;
let result = turf.difference(worldPolygon, multiPolygon);
The output from Turf.js v5.16 works as expected, but in Turf.js v6.5, the result is incorrect.
Expected Result:
The world polygon should have the specified holes subtracted correctly, and the resulting polygon should reflect these changes.
https://jsfiddle.net/om39s8fh/1/
Actual Result:
In Turf.js v6.5 and recent versions, the output is incorrect, and the holes do not seem to be subtracted from the world polygon as expected.
https://jsfiddle.net/yg2dj108/2/
The text was updated successfully, but these errors were encountered: