ST_Value

更新时间:
复制 MD 格式

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

ParameterDescription
rastThe raster object.
bandThe band number. Starts at 0. Default: 0.
colsnThe column number of the cell. Default: 0.
rowsnThe row number of the cell. Default: 0.
exclude_nodata_valueSpecifies 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)