PostGIS
Name
ST_Mean4ma — Raster processing function that calculates the mean pixel value in a neighborhood.
Synopsis
float8 +`*`+ST_Mean4ma
*(`float8[][] `matrix
, text
nodatamode
, text[] VARIADIC args`
)`;
double precision +`*`+ST_Mean4ma
*(`double precision[][][]
`value
, integer[][] pos
, text[] VARIADIC userargs`
)`;
Description
Calculate the mean pixel value in a neighborhood of pixels.
For Variant 2, a substitution value for NODATA pixels can be specified by passing that value to userargs.
|
|
|
Availability: 2.0.0
Enhanced: 2.1.0 Addition of Variant 2
Examples: Variant 1
SELECT
rid,
st_value(
st_mapalgebrafctngb(rast, 1, '32BF', 1, 1, 'st_mean4ma(float[][],text,text[])'::regprocedure, 'ignore', NULL), 2, 2
)
FROM dummy_rast
WHERE rid = 2;
rid | st_value
-----+------------------
2 | 253.222229003906
(1 row)
Examples: Variant 2
SELECT
rid,
st_value(
ST_MapAlgebra(rast, 1, 'st_mean4ma(double precision[][][], integer[][], text[])'::regprocedure,'32BF', 'FIRST', NULL, 1, 1)
, 2, 2)
FROM dummy_rast
WHERE rid = 2;
rid | st_value
-----+------------------
2 | 253.222229003906
(1 row)
See Also
ST_MapAlgebraFctNgb, ST_MapAlgebra (callback function version), ST_Min4ma, ST_Max4ma, ST_Sum4ma, ST_Range4ma, ST_StdDev4ma
ST_Max4ma |
ST_Min4ma |