All Products
Search
Document Center

PolarDB:ST_Extent

Last Updated:Mar 28, 2026

Returns the bounding box of a raster as a PostgreSQL BOX value in ((maxX,maxY),(minX,minY)) format.

Syntax

BOX ST_Extent(raster raster_obj, CoorSpatialOption csOption = 'WorldFirst')
BOX ST_Extent(raster raster_obj, integer pyramid, CoorSpatialOption csOption = 'WorldFirst')

Parameters

ParameterDescription
raster_objThe raster whose bounding box you want to retrieve.
pyramidThe pyramid level of the raster. Valid values start from 0.
csOptionThe coordinate system for the returned bounding box. Defaults to WorldFirst.

csOption values

ValueDescription
RasterReturns pixel coordinates.
WorldReturns world coordinates.
WorldFirstReturns world coordinates if the raster is georeferenced; otherwise falls back to pixel coordinates.
Note: The return format is ((maxX,maxY),(minX,minY)) — the maximum values come first.

Examples

Return pixel coordinates:

SELECT ST_Extent(raster_obj, 'Raster'::CoorSpatialOption) FROM raster_table;

Result:

((255, 255), (0, 0))