0.5.2 • Published 3 years ago
@mapbox/geojson-rewind v0.5.2
geojson-rewind
The GeoJSON specification is picky about winding order.
This helps you generate compliant Polygon and MultiPolygon geometries. Furthermore it lets you use Canvas and other drawing libraries's default behavior to color the interior rings of Polygon and MultiPolygon features.
Usage
As NPM module:
npm install --save @mapbox/geojson-rewindAs a console utility:
# install
npm install -g @mapbox/geojson-rewind
# use
geojson-rewind foo.geojsonAs a browser library: geojson-rewind.js
API
rewind(geojson, clockwise)
Given a GeoJSON FeatureCollection, Feature, or Geometry, return a version with inner and outer rings of different winding orders.
If clockwise is true, the outer ring is clockwise, otherwise
it is counterclockwise.
