> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_Extent

Returns the planar bounding box of all geometries in `A` as a typed `Box2D`. Empty geometries and null values are skipped. If all inputs are empty or null, the result is null. Mirrors PostGIS `ST_Extent`.

`ST_Extent` is the typed counterpart to [ST\_Envelope\_Agg](/reference/wherobots-db/geometry-data/aggregate/ST_Envelope_Agg). `ST_Envelope_Agg` returns the envelope as a `Geometry`; `ST_Extent` returns it as a `Box2D` value that serializes to a struct of four doubles.

## Signatures

```sql theme={"system"}
ST_Extent(A: geometryColumn)
```

## Parameters

<ParamField body="A" type="Geometry" required>
  The column of geometries to aggregate.
</ParamField>

## Return type

<ResponseField type="Box2D">
  The planar bounding box enclosing every geometry in the column.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_AsText(ST_Extent(geom))
FROM VALUES
    (ST_GeomFromText('POINT (1 1)')),
    (ST_GeomFromText('POINT (5 7)')),
    (ST_GeomFromText('LINESTRING (3 2, 6 4)')) AS t(geom)
```

```
BOX(1.0 1.0, 6.0 7.0)
```
