Skip to content

Takes a point, linestring, polygon, or featurecollection, and flips all of its coordinates from [x, y] to [y, x].

License

Notifications You must be signed in to change notification settings

turf-junkyard/turf-flip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Takes a point, linestring, polygon, or featurecollection, and flips all of its coordinates from [x, y] to [y, x].

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •