All Products
Search
Document Center

PolarDB:ST_PixelAsPolygon

Last Updated:Mar 28, 2026

Returns the polygon geometry that bounds a specified pixel in a raster.

Syntax

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

Parameters

ParameterDescription
raster_objThe raster to query.
rowThe row index of the pixel. Valid values start from 0, where 0 indicates the top-left pixel.
columnThe column index of the pixel. Valid values start from 0, where 0 indicates the top-left pixel.
pyramidThe pyramid level of the pixel.

Examples

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

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