st_envelope
function
Applies to: Databricks SQL
Databricks Runtime 17.1 and above
Preview
This feature is in Public Preview.
nota
This feature is not available on Databricks SQL Classic warehouses. To learn more about Databricks SQL warehouses, see SQL warehouse types
Returns a 2D Cartesian geometry representing the 2D axis-aligned minimum bounding box (envelope) of the input geometry. If the input geometry is empty, it is returned as entered.
Syntax
st_envelope ( geoExpr )
Arguments
geoExpr
: AGEOMETRY
value.
Returns
A value of type GEOMETRY
, representing the 2D axis-aligned minimum bounding box of the input geometry.
The function returns NULL
if the input is NULL
.
Examples
SQL
-- Returns the envelope of a polygon geometry.
> SELECT st_astext(st_envelope(st_geomfromtext('POLYGON((-1 0,0 -1,1 0,0 1,-1 0))')));
POLYGON((-1 -1,-1 1,1 1,1 -1,-1 -1))
-- Returns the envelope of a point geometry.
> SELECT st_astext(st_envelope(st_geomfromtext('POINT(5 10)')));
POINT(5 10)