Name

ST_Distinct4ma — 栅格处理函数,用于计算邻域中唯一像素值的数量。

Synopsis

float8 ST_Distinct4ma ( float8[][] matrix , text nodatamode , text[] VARIADIC args ) ;

double precision ST_Distinct4ma ( double precision[][][] value , integer[][] pos , text[] VARIADIC userargs ) ;

描述

计算像素邻域中唯一像素值的数量。

[Note]

变体1是一个专门的回调函数,用作 ST_MapAlgebraFctNgb

[Note]

变体2是一个专门的回调函数,用作 ST_MapAlgebra(回调函数版本)

[Warning]

不鼓励使用备选方案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)
                

另请参阅

ST_MapAlgebraFctNgb , ST_MapAlgebra(回调函数版本) , ST_Min4ma , ST_Max4ma , ST_Sum4ma , ST_Mean4ma , ST_Distinct4ma , ST_StdDev4ma