All Products
Search
Document Center

PolarDB:ST_Envelope

Last Updated:Mar 28, 2026

Returns the bounding box of a raster as a geometry.

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 at which the raster resides. Valid values start from 0. Default value: 0.

Description

ST_Envelope returns the bounding box of a raster as a POLYGON geometry.

Bounding box

Examples

Get the bounding box 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 a specific pyramid level:

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

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