-
Notifications
You must be signed in to change notification settings - Fork 24
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
voronoi.polygons([data]) outputs non-compliant GeoJSON #2
Comments
Excellent remark. Would you mind sending a PR? |
I also had to fix the others, now with google maps all this works without any change:
Unfortunately polygons is still not working correctly / not compliant because it is not respecting the right-hand rule. You can validate the output for example at: http://geojsonlint.com/ This is a problem for the basic case where you have 2 points, so both polygons will have the same coordinates, but they enclose opposite globe areas. I think you should take a look at it, because fixing it will probably break other (non-conformant) applications. |
As per RFC 7946:
|
Also mind that Sphere is not valid type (geometry.type = "Sphere";). And the bug I'm seeing might be also due to:
|
It seems that part of this issue, or all of it, might be to a non-compliante on Google Maps. I just filled the bug with the team: |
Yes the I don't think d3-geo-voronoi should cut shapes across the antimeridian — maybe add a clipper in your application when it's needed. It's one of those infuriating rules :) As for the coding style, let's try and stick to d3's style as much as possible. |
I think Sphere was used because of the lack of the right hand rule, which didn't exist initially on GeoJSON. But for me I don't care for the Sphere or antimeridian cutting case, but following the right hand rule is quite important, as otherwise the polygons created are ambiguous (and they fail GeoJSON linting). |
I'm not sure if your comment about the right-hand rule implies that there is still a bug? I think we're good, but I might be wrong :) If that's the case please open an issue. |
Yes. The output json still fails GeoJSON linting due to violating the right hand rule. I'll open a issue with tests or examples later today, since fixing it might be over my league. |
Hi!
The current output of polygons looks like this:
According to http://geojson.org/:
So to make it compliant it should be instead like:
Thanks!
The text was updated successfully, but these errors were encountered: