All Products
Search
Document Center

ApsaraDB RDS:ST_PixelAsPolygon

Last Updated:Mar 28, 2026

Returns the polygon geometry that bounds the pixel at a specified row and column in a raster.

Syntax

geometry ST_PixelAsPolygon(raster raster_obj,
                            integer row default 0,
                            integer column default 0,
                            integer pyramid default 0);

Parameters

ParameterTypeDefaultDescription
raster_objrasterThe raster to query.
rowinteger0The row index of the target pixel. Valid values start from 0, where 0 is the top row of the raster.
columninteger0The column index of the target pixel. Valid values start from 0, where 0 is the leftmost column of the raster.
pyramidinteger0The pyramid level in which the pixel resides.

Examples

SELECT ST_AsText(ST_PixelAsPolygon(rast, 10, 10))
FROM rast_table
WHERE id = 10;

Expected output:

POLYGON((3427927.75 5793244,3427927.8 5793244,3427927.8 5793243.95,...