Skip to content

Bounds

deckgl_marimo.compute_bounds

compute_bounds(data, *, position=None, get_coordinates=None)

Compute [[west, south], [east, north]] enclosing all coordinates in data.

Parameters:

Name Type Description Default
data Any

A GeoJSON dict (FeatureCollection/Feature/geometry), a list of items (each a [lon, lat] pair, a dict with coordinates/path/ polygon/position, or a GeoJSON Feature), or any tabular data the library accepts (DataFrame, DuckDB relation, ...) when combined with position.

required
position list[str] | None

Column names for longitude and latitude, e.g. ["lon", "lat"] — the same form layer get_position accessors take. Use for tabular data whose coordinates live in plain columns.

None
get_coordinates Callable[[Any], Any] | None

Optional accessor mapping each item to its coordinate(s); use when coordinates live under a non-standard key.

None

Returns:

Type Description
list[list[float]]

[[west, south], [east, north]].

Raises:

Type Description
ValueError

If no coordinates are found.