ST_Value

Updated at:

Returns the value of a raster cell at the specified band, column, and row.

Syntax

float8 ST_Value(raster rast, integer band, integer colsn, integer rowsn, boolean exclude_nodata_value=true);

Parameters

ParameterTypeDescription
rastrasterThe raster object.
bandintegerThe sequence number of the band. Band numbering starts at 0. Default: 0.
colsnintegerThe column number of the cell. Default: 0.
rowsnintegerThe row number of the cell. Default: 0.
exclude_nodata_valuebooleanSpecifies whether to exclude the NoData value. Default: true.

Example

select st_value(rast, 1, 3, 4) from t_pixel where id=2;
 st_value
----------
       88
(1 row)

This query retrieves the cell value from band 1, column 3, row 4 of the raster stored in t_pixel where id=2.