#geo-json #order #polygon #enforce #ring #winding

geojson_rewind

Enforce polygon ring winding order for GeoJSON

1 unstable release

Uses old Rust 2015

0.2.0 Aug 25, 2018

#8 in #enforce

MIT license

5KB
60 lines

GeoJSON-Rewind

Enforce polygon ring winding order for GeoJSON

Rust port of @mapbox/geojson-rewind

Build Status

The GeoJSON specification is picky about winding order.

This helps you generate compliant Polygon and MultiPolygon geometries.

API

rewind(geojson: &mut geojson::Feature, outer: bool)

Given a GeoJSON FeatureCollection, Feature, or Geometry, return a version with inner and outer rings of different winding orders.

If outer is true, the outer ring is clockwise, otherwise it is counterclockwise.

Dependencies

~1–1.6MB
~31K SLoC