Package Exports
- @mapbox/geojson-coords
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@mapbox/geojson-coords) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
geojson-coords
Extract coordinates from GeoJSON.
install
npm install --save @mapbox/geojson-coordsapi
coords(geojson)
Given any valid GeoJSON object, return a single array of coordinates that it contains. Handles any root object, collapses multidimensional coordinate arrays and expands point coordinate arrays.
example
var geojsonCoords = require('@mapbox/geojson-coords');
geojsonCoords({
"type": "GeometryCollection",
"geometries": [
{
"type": "Point",
"coordinates": [100.0, 0.0]
},
{
"type": "LineString",
"coordinates": [ [101.0, 0.0], [102.0, 1.0] ]
}
]
});
// returns [[100, 0], [101, 0], [102, 1]];