Returns a point geometry for a specified pixel in a raster. By default, the point is placed at the upper-left corner of the pixel.
Syntax
geometry ST_PixelAsPoint(raster raster_obj,
integer row default 0,
integer column default 0,
integer pyramid default 0,
cstring ref_point default 'UPPERLEFT') ;Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster to query. |
row | The pixel row index (y-axis). Valid values start from 0, which is the upper-left corner of the raster. |
column | The pixel column index (x-axis). Valid values start from 0, which is the upper-left corner of the raster. |
pyramid | The pyramid level of the pixel. |
ref_point | The reference position of the returned point within the pixel. Valid values: UPPERLEFT (upper-left corner of the pixel) and CENTER (center of the pixel). Default: UPPERLEFT. |
Example
SELECT ST_AsText(ST_PixelAsPoint(rast, 10, 10))
FROM rast_table
WHERE id = 10;
------------------
POINT(-178.2 88.2)