Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
enforce polygon ring winding order for geojson
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.travis.yml
HELP.md
LICENSE.txt
Makefile
README.md
geojson-rewind
geojson-rewind.js
index.js
package.json

README.md

Build Status

geojson-rewind

The GeoJSON specification is not picky about winding order, but this is.

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

as console utility

# install
npm install -g geojson-rewind
# use
geojson-rewind foo.geojson

as browser library

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

Something went wrong with that request. Please try again.