Skip to content

Latest commit

 

History

History
57 lines (34 loc) · 929 Bytes

README.md

File metadata and controls

57 lines (34 loc) · 929 Bytes

turf-flip

build status

turf flip module

turf.flip(input)

Takes input features and flips all of their coordinates from [x, y] to [y, x].

Parameters

parameter type description
input Feature,FeatureCollection input features

Example

var serbia = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [20.566406, 43.421008]
  }
};

//=serbia

var saudiArabia = turf.flip(serbia);

//=saudiArabia

Returns Feature,FeatureCollection, a feature or set of features of the same type as input with flipped coordinates

Installation

Requires nodejs.

$ npm install turf-flip

Tests

$ npm test