Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - Spatial Data Support » Spatial types and functions » ST_Geometry type

ST_Envelope method

Returns the bounding rectangle for the geometry value.

Syntax
geometry-expression.ST_Envelope()
Returns
  • ST_Polygon

    Returns a polygon that is the bounding rectangle for the geometry-expression.

    The spatial reference system identifier of the result is the same as the spatial reference system of the geometry-expression.

Remarks

The ST_Envelope method constructs a polygon that is an axis-aligned bounding rectangle for the geometry-expression. The envelope covers the entire geometry, and it can be used as a simple approximation for the geometry.

Note If the geometry-expression is an empty geometry (ST_IsEmpty()=1), then this method returns NULL.
Note This method cannot be used with geometries in round-Earth spatial reference systems.
Standards
  • SQL/MM (ISO/IEC 13249-3: 2006)

    5.1.15

Example

The following example returns the result Polygon ((0 0, 1 0, 1 4, 0 4, 0 0)).

SELECT Shape.ST_Envelope()
FROM SpatialShapes WHERE ShapeID = 6

The following returns the result Polygon ((0 0, 1 0, 1 1, 0 1, 0 0)).

SELECT NEW ST_LineString('LineString(0 0, 1 1)').ST_Envelope()