Skip to content
🌵SedonaDB (Rust) 0.3.0 is out now, featuring larger-than-memory spatial joins, and row-level CRS!

ST_Envelope_Agg

Introduction: Return the entire envelope boundary of all geometries in A

ST_Envelope_Agg

Format: ST_Envelope_Agg (A:geometryColumn)

Return type: Geometry

Note

This function was previously named ST_Envelope_Aggr, which is deprecated since v1.8.1.

SQL example:

WITH src_tbl AS (
    SELECT sedona.ST_GeomFromText('POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))') AS geom
    UNION
    SELECT sedona.ST_GeomFromText('POLYGON ((0.5 0.5, 0.5 1.5, 1.5 1.5, 1.5 0.5, 0.5 0.5))') AS geom
)
SELECT sedona.ST_AsText(envelope)
FROM src_tbl,
     TABLE(sedona.ST_Envelope_Agg(src_tbl.geom) OVER (PARTITION BY 1));

Output:

POLYGON ((0 0, 0 1.5, 1.5 1.5, 1.5 0, 0 0))