> ## 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_3DExtent

Returns the 3D bounding box of all geometries in `A` as a typed `Box3D`. Empty geometries and null values are skipped. If all inputs are empty or null, the result is null. Geometries without a Z dimension fold into `z = 0`. Mirrors PostGIS `ST_3DExtent`.

`ST_3DExtent` is the 3D counterpart to [ST\_Extent](/reference/wherobots-db/geometry-data/aggregate/ST_Extent), which returns a `Box2D`.

<img src="https://mintcdn.com/wherobots/XpQVzmvmMISOboEb/images/sql-functions/box3d/st_3dextent.svg?fit=max&auto=format&n=XpQVzmvmMISOboEb&q=85&s=be4dfbc63cd071494e4bf01dd21c539d" alt="ST_3DExtent aggregates a column of geometries into the enclosing cuboid" width="360" height="275" data-path="images/sql-functions/box3d/st_3dextent.svg" />

## Signatures

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

## Parameters

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

## Return type

<ResponseField type="Box3D">
  The 3D bounding box enclosing every geometry in the column.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_AsText(ST_3DExtent(geom))
FROM VALUES
    (ST_GeomFromText('POINT Z (1 2 3)')),
    (ST_GeomFromText('POINT Z (4 5 -1)')),
    (ST_GeomFromText('LINESTRING (-3 0, 0 0)')) AS t(geom)
```

```
BOX3D(-3.0 0.0 -1.0, 4.0 5.0 3.0)
```

The XY-only linestring contributes `z = 0`, which sits between the `-1` and `3` of the two POINT Z rows, so it does not move either Z bound.
