-
Notifications
You must be signed in to change notification settings - Fork 161
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
geoContains is not working #112
Comments
Your polygon appears to be counterclockwise, but d3 expects a clockwise
order (contrary to GeoJSON spec).
http://bl.ocks.org/Fil/263ffe9c05523d2950dac83a44ec1b06
https://github.com/d3/d3-geo/#d3-geo
https://tools.ietf.org/html/rfc7946
|
Oh thanks Fil! So i forced to use other library. |
You can reverse the coordinates of the polygon rings to flip the winding order. |
Standard GeoJSON is planar rather than spherical, so if we implement path.contains #109 it would be easy to test for containment using d3.geoIdentity as the projection. |
probably better off just using this: geoContains some times does not even work when the coords are counter clockwise. =/ |
According to
geoContains
method, the center of Moscow is not contained in Moscow Area (it returnedfalse
), which is a strange fact :) Code snippet to test:https://runkit.com/embed/cw2rh9zbcbcr
(or in gist https://gist.github.com/psi-gh/6f8e7b356f2bb5086cb98c58fbd0d588)
The text was updated successfully, but these errors were encountered: