-
Notifications
You must be signed in to change notification settings - Fork 952
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
Difference between polygons results in "Unable to complete output ring starting at ..." #2277
Comments
This is an upstream problem in |
I am wondering if there is any progress on this. I did see mfogel/polygon-clipping#91 and it was recently noted that someone solved it by switching to polyclip-ts. Perhaps polyclip is a better library? With my own code, I used polyclip directly when computing an intersection and it worked. While it does appear that polygon-clipping and polyclip are written by the same people, for some reason polyclip is more reliable. This issue is a blocker and I am unable to proceed using turf. I hope it can be fixed soon. |
Thanks for the link @eric-g-97477 to polyclip-ts, I haven't seen that library before. It looks like a fork of polygon-clipping that has had some modifications, some of which are obviously making a difference. I'll try and set aside some time to do a more thorough assessment. |
@rowanwins To help with your assessment, the author of There doesn't seem to be a downside to swapping out the dependency. I'm one of the people that ran into a bug with Turf/polygon-clipping and confirmed it was fixed by switching to polyclip-ts. The algorithms it uses are based on a 2009 paper published on the topic of boolean operations on polygons: https://www.sciencedirect.com/science/article/abs/pii/S0965997813000379 The only way I could see to improve it would to swap in a more performant algorithm for a case where you would be sure it wouldn't crash like |
@twelch Some performance improvements can be achieved using the current approach. However, with certain changes, this package can attain great flexibility and achieve excellent performance when not requiring high precision. An update is planned. |
Version: 6.5.0
turf.difference crushes with
Input polygons
The text was updated successfully, but these errors were encountered: