shapefile
shapefile copied to clipboard
Support other winding conventions (cw, ccw, spherical, etc.)
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.
Getting the same error this makes the resulting json unusable in later mapbox implementations etc.
This package follows the convention in d3-geo, TopoJSON and ESRI shapefiles, which is (unfortunately) the opposite convention of GeoJSON’s RFC 7946.
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).