包详细信息

@mapwhit/geojson-rewind

mapwhit16ISC1.0.0

enforce winding order for geojson

geojson, winding, order, rendering

自述文件

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

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.

更新日志

1.0.0 / 2018-12-22

  • rewrite in ES6
  • replace @mapbox/geojson-area with @mapwhit/geojson-area
  • remove CLI support
  • rename to @maphit/geojson-rewind