shapefile icon indicating copy to clipboard operation
shapefile copied to clipboard

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

Open indiejames opened this issue 4 years ago • 3 comments

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.

indiejames avatar Apr 01 '20 21:04 indiejames

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

skjortan23 avatar Jun 12 '20 06:06 skjortan23

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

Fil avatar Feb 08 '22 09:02 Fil

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 avatar Feb 08 '22 16:02 mbostock