Skip to main content
Version: 6.5.0

bbox

Description​

Takes a set of features, calculates the bbox of all input features, and returns a bounding box.

Parameters​

NameTypeDescription
geojsonGeoJSONany GeoJSON object

Returns​

    BBox bbox extent in [minX, minY, maxX, maxY] order

Examples​

var line = turf.lineString([
[-74, 40],
[-78, 42],
[-82, 35],
]);
var bbox = turf.bbox(line);
var bboxPolygon = turf.bboxPolygon(bbox);

Installation​

$ npm install @turf/bbox

import { bbox } from "@turf/bbox";
const result = bbox(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.bbox(...);