ST_ENVELOPE
functionsupportedCore SQL functionsdeprecatedReturns the minimum bounding box (a rectangular “envelope”) that encloses a specified GEOGRAPHY or GEOMETRY object. This function has been deprecated for GEOGRAPHY objects. The use of this function with GEOGRAPHY objects will be obsoleted in a future release (TBD). As an alternative, for GEOGRAPHY objects, use ST_XMIN, ST_XMAX, ST_YMIN, and ST_YMAX to determine the vertices of the bounding box around an input GEOGRAPHY object.
Syntax
ST_ENVELOPE( <geography_or_geometry_expression> )
Parameters
| Name | Required | Description |
|---|---|---|
geography_or_geometry_expression | required | The argument must be of type GEOGRAPHY or GEOMETRY. |
Returns
The function returns a value of type GEOGRAPHY or GEOMETRY that represents the minimum bounding box around the input object.
Usage notes
- For GEOGRAPHY objects: If geography_expression is a LineString that represents a meridian arc (an arc along a line of longitude), ST_ENVELOPE returns that LineString.
- If geography_expression is a LineString that represents an arc on a parallel (an arc along a line of latitude) other than the equator, ST_ENVELOPE returns a Polygon that represents the bounding box for the arc.
- If geography_expression is a single Point, ST_ENVELOPE returns that Point.
- For GEOMETRY objects: In degenerate cases (e.g. where the input is a point or a vertical or horizontal line), the function may return a geometry of lower dimension (i.e. a Point or LineString).
- For GEOMETRY objects, the returned GEOMETRY object has the same SRID as the input.