Package Exports
- turf-extent
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 (turf-extent) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
turf-extent
turf extent module
turf.extent(input)
Takes any GeoJSON object, calculates the extent of all input features, and returns a bounding box.
Parameters
| parameter | type | description |
|---|---|---|
input |
GeoJSON | any valid GeoJSON Object |
Example
var input = turf.featurecollection([
turf.point([114.175329, 22.2524]),
turf.point([114.170007, 22.267969]),
turf.point([114.200649, 22.274641]),
turf.point([114.186744, 22.265745])
]);
var bbox = turf.extent(input);
var bboxPolygon = turf.bboxPolygon(bbox);
bboxPolygon.properties.fill = '#00f';
var result = turf.featurecollection(
input.features.concat(bboxPolygon));
//=resultInstallation
Requires nodejs.
$ npm install turf-extentTests
$ npm test