📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ST_ENVELOPE



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)) │ ╰────────────────────────────────────────────────────────────╯

Was this page helpful?