turf-reverse

1.0.0 • Public • Published

turf-reverse

build status

Revert coordinates order for LineString, Polygon, MultiLineString and MultiPolygon features.

turf.reverse(feature)

Revert feature geometry coordinates order

Parameters

parameter type description
feature Object GeoJSON feature

Example

var reverse = require('turf-reverse');
 
var lineString = {
  "type": "Feature",
  "properties": {},
  "geometry": { "type": "LineString", "coordinates": [[100.0, 0.0], [101.0, 1.0]] }
}
 
var lineStringReverse = reverse(lineString);
//=lineStringReverse

Returns Object, feature with reversed coordinates

Installation

Requires nodejs.

$ npm install turf-reverse

Tests

$ npm test

/turf-reverse/

    Package Sidebar

    Install

    npm i turf-reverse

    Weekly Downloads

    18

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • stepankuzmin