Reads every point/vertex in every component of every feature in a geometry, and if the longitude coordinate is < 0, adds 360 to it. The result would be a 0-360 version of the data to be plotted in a 180 centric map.
parameter | type | description |
---|---|---|
layer |
Object | any GeoJSON object |
var shift = require('turf-shift-longitude');
var point = { type: 'Point', coordinates: [-175, 70] };
var shifted = shift(point);
//=shifted
Returns Object
, layer shifted GeoJSON object
Requires nodejs.
$ npm install turf-shift-longitude
$ npm test