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