All Products
Search
Document Center

ApsaraDB RDS:ST_Envelope

Last Updated:Mar 28, 2026

Returns the bounding box of a raster as a geometry object.

Syntax

geometry ST_Envelope(raster source);
geometry ST_Envelope(raster source, integer pyramid);

Parameters

ParameterDescription
sourceThe raster whose bounding box you want to obtain.
pyramidThe pyramid level of the raster. Valid values start from 0. Default value: 0.

Description

ST_Envelope returns the minimum bounding rectangle of a raster as a polygon geometry. You can use the pyramid parameter to obtain the bounding box at a specific pyramid level.

Bounding box

Examples

Get the bounding box of a raster at the default pyramid level (0):

SELECT st_astext(st_envelope(rast_object))
FROM raster_table;

----------------------------------------------------
 POLYGON((-180 90,180 90,180 -90,-180 -90,-180 90))

Get the bounding box at pyramid level 1:

SELECT st_astext(st_envelope(rast_object, 1))
FROM raster_table;

----------------------------------------------------
 POLYGON((-180 90,180 90,180 -90,-180 -90,-180 90))