@mapbox/geojson-rewind
enforce winding order for geojson
Last updated 6 years ago by mapbox-npm-09 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @mapbox/geojson-rewind 
SYNC missed versions from official npm registry.

Build Status

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-rewind

As a console utility:

# install
npm install -g @mapbox/geojson-rewind
# use
geojson-rewind foo.geojson

As 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.

Current Tags

  • 0.5.2                                ...           latest (3 years ago)

5 Versions

  • 0.5.2                                ...           3 years ago
  • 0.5.1                                ...           4 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.0                                ...           6 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE