8000 GitHub - eivinhb/geojson-flip: Small Node.js util method with no dependencies to flip coordinates (lon/lat) in geojson documents. · GitHub
[go: up one dir, main page]

Skip to content

About

Small Node.js util method with no dependencies to flip coordinates (lon/lat) in geojson documents.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

Repository files navigation

Build Status Coverage Status

GeoJson-flip

I had to make this little util out of necessity. It only flips 2d geojson.

Geojson-spec says that `The order of elements must follow x, y, z order (easting, northing, altitude for coordinates in a projected coordinate reference system, or longitude, latitude, altitude for coordinates in a geographic coordinate reference system). Map websites like geojson.io and github gist (*.geojson) uses this order of coordinates. MongoDB also uses lon lat.

But applications differ as this web page show and should you encounter an issue with coordinates on the wrong, then flip em.

Usage

var flip = require(
5CB3
"geojson-flip").flip;

console.log(
    flip({
        "type": "FeatureCollection",
        "features": [
            {
                "type": "Feature",
                "geometry": {
                    "type": "Point",
                    "coordinates": [125.6, 10.1]
                },
                "properties": {}
            }
        ]
    }))
    
/**
{
        "type": "FeatureCollection",
        "features": [
            {
                "type": "Feature",
                "geometry": {
                    "type": "Point",
                    "coordinates": [10.1, 125.6]
                },
                "properties": {}
            }
        ]
    }

**/
    

About

Small Node.js util method with no dependencies to flip coordinates (lon/lat) in geojson documents.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0