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
| Parameter | Type | Default | Description |
|---|---|---|---|
raster_obj | raster | — | The raster to query. |
row | integer | 0 | The row index of the target pixel. Valid values start from 0, where 0 is the top row of the raster. |
column | integer | 0 | The column index of the target pixel. Valid values start from 0, where 0 is the leftmost column of the raster. |
pyramid | integer | 0 | The 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,...