turf-flip
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]
}
};
var saudiArabia = turf.flip(serbia);
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