turf-bbox
bbox
Takes a set of features, calculates the bbox of all input features, and returns a bounding box.
Parameters
geojson
(Feature | FeatureCollection) input features
Examples
var input = "type": "FeatureCollection" "features": "type": "Feature" "properties": {} "geometry": "type": "Point" "coordinates": 114175329 222524 "type": "Feature" "properties": {} "geometry": "type": "Point" "coordinates": 114170007 22267969 "type": "Feature" "properties": {} "geometry": "type": "Point" "coordinates": 114200649 22274641 "type": "Feature" "properties": {} "geometry": "type": "Point" "coordinates": 114186744 22265745 ; var bbox = turf; var bboxPolygon = turf; var resultFeatures = inputfeatures;var result = "type": "FeatureCollection" "features": resultFeatures; //=result
Returns Array<number> the bounding box of input
given
as an array in WSEN order (west, south, east, north)
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install turf-bbox
Or install the Turf module that includes it as a function:
$ npm install turf