
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
@turf/bbox
Advanced tools
Calculates the bounding box for any GeoJSON object, including FeatureCollection. Uses geojson.bbox if available and options.recompute is not set.
geojson GeoJSON any GeoJSON object
options Object Optional parameters (optional, default {})
options.recompute boolean? Whether to ignore an existing bbox property on geojsonvar line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]);
var bbox = turf.bbox(line);
var bboxPolygon = turf.bboxPolygon(bbox);
//addToMap
var addToMap = [line, bboxPolygon]
Returns BBox bbox extent in [minX, minY, maxX, maxY] order
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.
Install this single module individually:
$ npm install @turf/bbox
Or install the all-encompassing @turf/turf module that includes all modules as functions:
$ npm install @turf/turf
The geojson-bbox package provides similar functionality to @turf/bbox by calculating the bounding box for GeoJSON objects. It is a lightweight alternative but does not offer the extensive suite of geospatial tools available in the Turf.js library.
The bbox package is another alternative that focuses on calculating bounding boxes for various types of GeoJSON objects. It is simpler and more focused compared to @turf/bbox, which is part of a larger geospatial analysis library.
FAQs
turf bbox module
The npm package @turf/bbox receives a total of 1,345,445 weekly downloads. As such, @turf/bbox popularity was classified as popular.
We found that @turf/bbox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.

Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.

Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.