ST_Count — 返回栅格或栅格覆盖指定波段中的像素数量。如果未指定波段,则默认为波段 1。如果 exclude_nodata_value 设置为 true,则仅计算不等于 nodata 值的像素。
bigint ST_Count(raster rast, integer nband=1, boolean exclude_nodata_value=true);
bigint ST_Count(raster rast, boolean exclude_nodata_value);
返回栅格或栅格覆盖指定波段中的像素数量。如果未指定波段 nband,则默认为 1。
|
|
|
如果 |
变更: 3.1.0 - 删除了 ST_Count(rastertable, rastercolumn, ...) 变体。请改用 ST_CountAgg。
可用性: 2.0.0
--example will count all pixels not 249 and one will count all pixels. --
SELECT rid, ST_Count(ST_SetBandNoDataValue(rast,249)) As exclude_nodata,
ST_Count(ST_SetBandNoDataValue(rast,249),false) As include_nodata
FROM dummy_rast WHERE rid=2;
rid | exclude_nodata | include_nodata
-----+----------------+----------------
2 | 23 | 25