Name

ST_PixelAsCentroid — Returns the centroid (point geometry) of the area represented by a pixel.

Synopsis

geometry ST_PixelAsCentroid(raster rast, integer x, integer y);

Description

Returns the centroid (point geometry) of the area represented by a pixel.

Enhanced: 3.2.0 Faster now implemented in C.

Availability: 2.1.0

Examples

Code
SELECT ST_PixelAsCentroid(rast, 1, 1) FROM dummy_rast WHERE rid = 1;
Output
POINT(1.5 2)
Figure
Geometry figure for visual-rt-st-pixelascentroid-01