@mapbox/geojson-rewind

0.5.2 • Public • Published

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.5.2
    864,386
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.5.2
    864,386
  • 0.5.1
    95,222
  • 0.5.0
    33,996
  • 0.4.1
    24,049
  • 0.4.0
    7,110

Package Sidebar

Install

npm i @mapbox/geojson-rewind

Weekly Downloads

1,024,763

Version

0.5.2

License

ISC

Unpacked Size

4.59 kB

Total Files

5

Last publish

Collaborators

  • mbx-npm-ci-production
  • mbx-npm-ci-staging
  • mbx-npm-advanced-actions-production
  • mbx-npm-advanced-actions-staging
  • mbx-npm-09-production
  • mbx-npm-08-production
  • mbx-npm-07-production
  • mbx-npm-06-production
  • mbx-npm-05-production
  • mbx-npm-04-production
  • mbx-npm-03-production
  • mbx-npm-02-production
  • mbx-npm-01-production
  • mbx-npm-02-staging
  • mapbox-npm-01
  • mapbox-npm-02
  • mapbox-npm-07
  • mapbox-npm-03
  • mapbox-npm-04
  • mapbox-npm-09
  • mapbox-npm-05
  • mapbox-npm-06
  • mapbox-npm-08
  • mapbox-npm-advanced-actions
  • mapbox-npm-ci
  • mapbox-npm
  • mapbox-admin
  • mapbox-machine-user