Atlaslog
Atlaslog / Turf.js / API reference / bbox
Turf.js · API reference

bbox

Quick answer

bbox computes the smallest axis-aligned rectangle enclosing any GeoJSON object and returns [minX, minY, maxX, maxY]. Pass a FeatureCollection to get one envelope for the whole set. Use it for quick coarse filtering or to drive map.fitBounds, since the array also feeds MapLibre LngLatBounds and Leaflet bounds helpers.

Last verified 2026-11-03 · Turf.js 7.x · Cite this page
turf.bbox( geojson ) → BBox
Key points
Example
var fc = turf.featureCollection([
  turf.point([116.39, 39.90]),
  turf.point([121.47, 31.23]),
  turf.point([113.26, 23.12])
]);

var box = turf.bbox(fc);
console.log(box);   // [113.26, 23.12, 121.47, 39.90]
var rect = turf.bboxPolygon(box);
rect.properties = { kind: 'coverage' };

/* 反过来,从一个面取回外包矩形 */
console.log(turf.bbox(rect));
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). bbox. https://www.jingweizhi.com/en/turf/api/bbox.html (accessed 2026-11-03).