Skip to content
pyautark (soon)

@urban-toolkit/autk-core


@urban-toolkit/autk-core / computeBoundingBox

Function: computeBoundingBox()

computeBoundingBox(source): BoundingBox | null

Defined in: utils-geojson.ts:72

Computes the geographic bounding box of a GeoJSON collection or geometry.

Parameters

source

Geometry | FeatureCollection<Geometry, GeoJsonProperties> | null

GeoJSON feature collection or geometry to inspect. Pass null to receive a null result.

Returns

BoundingBox | null

A named bounding box, or null when the source is empty or has no coordinates.

Throws

Never throws.

Example

ts
const bbox = computeBoundingBox(fc);
// bbox → { minLon: 151.0, minLat: -34.0, maxLon: 151.5, maxLat: -33.5 }

Released under the MIT License.