Skip to main content

ST_ENVELOPE

Introduced or updated: v1.2.895

Returns the minimum bounding rectangle of a GEOMETRY object as a polygon.

This function only supports GEOMETRY values.

Syntax

ST_ENVELOPE(<geometry>)

Arguments

ArgumentsDescription
<geometry>The argument must be an expression of type GEOMETRY.

Return Type

GEOMETRY.

Examples

SELECT ST_ASWKT(ST_ENVELOPE(TO_GEOMETRY('LINESTRING(0 0, 2 3)')));

╭────────────────────────────────────────────────────────────╮
│ st_aswkt(st_envelope(to_geometry('LINESTRING(0 0, 2 3)')))
│ String │
├────────────────────────────────────────────────────────────┤
POLYGON((0 0,2 0,2 3,0 3,0 0))
╰────────────────────────────────────────────────────────────╯
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today