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
| Parameter | Description |
|---|---|
raster_obj | The raster to query. |
row | The row index of the pixel. Valid values start from 0, where 0 indicates the top-left pixel. |
column | The column index of the pixel. Valid values start from 0, where 0 indicates the top-left pixel. |
pyramid | The 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,...