-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Unexpected error: Unable to find a ring sample point #205
Comments
I might have solved the problem. I'm closing it again.. |
In trying to find a sample point, we iterate the ring's triplet coordinates and add add the second coord from the end to allow checking the last triplet. Previously the second coordinate was added by changing the main coords list in-place, but that messes with the point-in-polygon algorithm. Fixed by only iterating through the points instead of changing the coords list. Fixes #205.
Glad that you were able to solve your problem, and yes overlapping polygons in a multipolygon would be considered invalid. However, after looking at your example file, the bug you encountered highlighted an actual problem with the hole-in-polygon code when it tries to find a sample point for a hole. It was a simple bug where the list of the hole coordinates was inadvertedly given an extra coordinate, which messed with the point-in-polygon test for short simple polygons as you had in your example file. Anyway, added a bug fix for that now, so thanks for stumbling across this! |
Ok, great you found and fixed a bug! |
Hi,
after the update from 2.1.0 to 2.1.2 I am getting errors for some Polygons when I try to access the
__geo_interface__
:Unexpected error: Unable to find a ring sample point
I guess it is related to 2d207e2
It might be related to holes in the Polygon, but I couldn't figure out why for some there is an error and for some there is no problem.
I create the polygons using the Shapely package. Here is a shapefile containing one example Polygon that fails: poly_fail.zip
Maybe this helps you finding the problem!
Thank you for providing this great tool!
The text was updated successfully, but these errors were encountered: