compute the bounding box of geojson features
npm install @mapbox/geojson-extent
Compute an extent given a GeoJSON object.
npm install --save @mapbox/geojson-extent
Live example with Mapbox Static Map API
``js
var geojsonExtent = require('geojson-extent');
geojsonExtent({ type: 'Point', coordinates: [0, 0] }); // returns 0,0,0,0 extent
`
Provides a binary that takes GeoJSON as stdin and returns a JSON stringified
array of extent data.
`sh`
$ npm install -g geojson-extent
$ geojson-extent < file.geojson
Given an argument of leaflet, this will return Leaflet-formatted data instead.
`sh`
$ geojson-extent leaflet < file.geojson
Given any valid GeoJSON object, return bounds in the form [WSEN].null
Invalid objects will return .
Given any valid GeoJSON object, return bounds in the form of a GeoJSON polygon object.
Invalid objects will return null`.
Add bounding boxes to all
appropriate GeoJSON objects - Feature, FeatureCollection, and Geometry.