-
Notifications
You must be signed in to change notification settings - Fork 5
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
signed_distance returns different answer if polygon is explicitly closed or not #57
Comments
Ah oops! I imagine we should probably filter that based on first + last coordinate... |
It's annoying because |
Not so easy to enforce repeats because we can wrap other polygon types We could have a |
Or just add the extra point to the end if necessary |
Hmm this means both Wonder how expensive that is - mostly what it does to the iterator |
Ah yeah, that would be expensive...I was thinking we could do this at construction, but it wouldn't solve the problem for external types. I suppose it would add a bit more complexity since most methods would be expecting a closed polygon as well, so they'd have to check for that each time they were called, which is suboptimal. |
Probably we can add a Then we could to |
import GeometryOps as GO
import GeoInterface as GI
pt = (1.1, 1.0)
rect_open = GI.Polygon([[(1.0, 1.0), (1.0, 2.0), (2.0, 2.0), (2.0, 1.0)]])
rect_closed = GI.Polygon([[(1.0, 1.0), (1.0, 2.0), (2.0, 2.0), (2.0, 1.0), (1.0, 1.0)]])
GO.signed_distance(pt, rect_open) # return 0.1
GO.signed_distance(pt, rect_closed) # return 0.0
The text was updated successfully, but these errors were encountered: