Skip to main content
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. 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

ST_Extent(A: geometryColumn)

Parameters

A
Geometry
required
The column of geometries to aggregate.

Return type

The planar bounding box enclosing every geometry in the column.

Example

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)