Skip to content
pyautark (soon)

@urban-toolkit/autk-core


@urban-toolkit/autk-core / computeOrigin

Function: computeOrigin()

computeOrigin(geojson): [number, number]

Defined in: utils-geojson.ts:52

Computes a spatial origin from a feature collection's bounding-box center.

Parameters

geojson

FeatureCollection

Feature collection to summarize.

Returns

[number, number]

The [longitude, latitude] center, or [0, 0] when no usable geometry is present.

Throws

Never throws.

Example

ts
const origin = computeOrigin(fc);
// origin → [151.2, -33.8]

Released under the MIT License.