Skip to content
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

Support other winding conventions (cw, ccw, spherical, etc.) #64

Open
indiejames opened this issue Apr 1, 2020 · 3 comments
Open

Support other winding conventions (cw, ccw, spherical, etc.) #64

indiejames opened this issue Apr 1, 2020 · 3 comments

Comments

@indiejames
Copy link

According to the GeoJSON spec (RFC 7946), outer rings of polygons MUST follow the right-hand rule, i.e., be counter-clockwise, whereas the output I see creates polygons with rings that use clockwise winding.

@skjortan23
Copy link

Getting the same error this makes the resulting json unusable in later mapbox implementations etc.

@Fil
Copy link

Fil commented Feb 8, 2022

This package follows the convention in d3-geo, TopoJSON and ESRI shapefiles, which is (unfortunately) the opposite convention of GeoJSON’s RFC 7946.

@mbostock
Copy link
Owner

mbostock commented Feb 8, 2022

Probably we should support an option that allows the clockwise and containment test to be overridden, or perhaps alternatively, we could enumerate different conventions (e.g., planar-cw, planar-ccw, spherical-cw).

@mbostock mbostock changed the title Polygon winding incorrect Support other winding conventions (cw, ccw, spherical, etc.) Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants