Pular para o conteúdo principal

st_envelope function

Applies to: check marked yes Databricks SQL check marked yes 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: A GEOMETRY 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)