-
Notifications
You must be signed in to change notification settings - Fork 448
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
Infinite loop in Polygonizer #874
Comments
Forgot to say that failure only happens with option "extractOnlyPolygonal=true" and that it has been tested with last snapshot |
Hi, I also discovered this infinite loop recently with the funny geometry attached (it's a bit smaller but equally awful than that from the OP). I might try to double check if the input gets properly noded beforehand. However, as you already pointed out, the infinite loop should be avoided somehow. Would be fantastic if you found a fix for that. Many thanks! |
I could simplify the problem to a minimum test case (containing a self-intersection) : I also successfully tried a patch to escape the infinite loop in the findDisjointShells method : if no new ring is tagged (isIncludedSet) during the inner loop iteration, we will never be able to go out the outer loop and we could throw an exception with a message about a probable noding problem). But there maybe a better solution. I tried to see if the problem can be catch earlier. Invalid rings are identified before entering findDisjointShells and maybe it is possible to clean the graph from problematic edges before the problem arises. Let me know what would be your preferred approach. |
An exception is preferable to an infinite loop, so that can be added until a better fix is found. |
Signed-off-by: Michaël Michaud <m.michael.michaud@orange.fr>
Here attached is an awful geometry (a GPS track) making Polygonizer entering an infinite loop.
I could not reduce the geometry to a simpler case.
Just found that the infinite loop is the do loop in Polygonizer#findDisjointShells(List shellList)
infinite_loop.zip
The text was updated successfully, but these errors were encountered: