Returns the value of a cell in a raster object, identified by band number, column number, and row number. Band numbers start at 0.
Syntax
float8 ST_Value(raster rast, integer band, integer colsn, integer rowsn, boolean exclude_nodata_value)Parameters
| Parameter | Description |
|---|---|
rast | The raster object. |
band | The band number. Starts at 0. Default: 0. |
colsn | The column number of the cell. Default: 0. |
rowsn | The row number of the cell. Default: 0. |
exclude_nodata_value | Specifies whether to exclude NoData values. Default: true. |
Description
Returns the value of a cell identified by its band number, column number, and row number. If you omit band, colsn, or rowsn, each defaults to 0.
Examples
Retrieve the value of the cell at column 3, row 4 in band 1 of the raster stored in t_pixel where id = 2:
select st_value(rast, 1, 3, 4) from t_pixel where id=2;
st_value
----------
88
(1 row)该文章对您有帮助吗?