-
Notifications
You must be signed in to change notification settings - Fork 317
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
Polygon.Intersects() not working #226
Comments
Check the area of both polygons. If one is near 4π then it's backwards and encloses the whole sphere except what you probably intended. Line 61 in ad1489e
|
Really appreciate your quick response!! Thanks a lot! What is the recommended action to avoid this scenario? EDIT - the area of the latter polygon is 4π. (12.564235290078345). |
The edges are always CCW by definition, so you can't check that. You can check for suspiciously large loops/polygons, though. You the conditions documented in the comments also need to be satisfied. Line 101 in ad1489e
Line 61 in ad1489e
You can use the Line 130 in ad1489e
Of course, in your example everything was valid AFAIK.
They intersect. What are you asking? |
Due to the whole sphere enclosure internal techniques as you hinted above, But the original polygons on the map don't intersect. (one is from US and the other is from india). |
I missed this before, but -282 is not a valid longitude.
Apparently you entered the complement of the second polygon. Reverse the vertices.
|
@jmr, my bad. It's all working fine! |
Not sure why the below polygon intersect unit test isn't working, it says the polygons intersect whereas the actual polygons aren't intersecting on the earth's surface.
Is there something the test does in the wrong way? Or
does anyone have any idea/clues as to what is going wrong here?
The text was updated successfully, but these errors were encountered: