ST_Distinct4ma — 栅格处理函数,用于计算邻域中唯一像素值的数量。
float8 ST_Distinct4ma(float8[][] matrix, text nodatamode, text[] VARIADIC args);
double precision ST_Distinct4ma(double precision[][][] value, integer[][] pos, text[] VARIADIC userargs);
计算像素邻域中唯一像素值的数量。
|
|
|
格式 1 是一个专门的回调函数,用作ST_MapAlgebraFctNgb的回调参数。 |
|
|
|
格式 2 是一个专门的回调函数,用作ST_MapAlgebra (callback function version)(回调函数版本)的回调参数。 |
|
|
|
不鼓励使用格式 1,因为 ST_MapAlgebraFctNgb 自 2.1.0 起已被弃用。 |
可用性: 2.0.0
增强:2.1.0 添加格式 2
SELECT
rid,
st_value(
st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_distinct4ma(float[][],text,text[])'::regprocedure, 'ignore', NULL), 2, 2
)
FROM dummy_rast
WHERE rid = 2;
rid | st_value
-----+----------
2 | 3
(1 row)