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
| Parameter | Type | Description |
|---|---|---|
rast | raster | The raster object. |
band | integer | The sequence number of the band. Band numbering starts at 0. Default: 0. |
colsn | integer | The column number of the cell. Default: 0. |
rowsn | integer | The row number of the cell. Default: 0. |
exclude_nodata_value | boolean | Specifies 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.
Is this page helpful?