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 (回调函数版本) 的回调参数。 |
|
|
|
不鼓励使用变体 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)