All Products
Search
Document Center

PolarDB:ST_Envelope

Last Updated:Mar 28, 2026

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

Syntax

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

Parameters

ParameterDescription
sourceThe source raster.
pyramidThe pyramid level of the raster. Valid values start from 0. Default value: 0.

Description

ST_Envelope returns the bounding box of a raster as a polygon.

Bounding box

Use the pyramid parameter to get the bounding box at a specific pyramid level.

Examples

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

SELECT ST_AsText(ST_Envelope(rast_object))
FROM raster_table;

Result:

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

Return the bounding box at pyramid level 1:

SELECT ST_AsText(ST_Envelope(rast_object, 1))
FROM raster_table;

Result:

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