Ticket #932 (closed task: fixed)
[raster] ST_StdDev
| Reported by: | dustymugs | Owned by: | dustymugs |
|---|---|---|---|
| Priority: | medium | Milestone: | PostGIS 2.0.0 |
| Component: | raster | Version: | trunk |
| Keywords: | history | Cc: |
Description
A function to get the standard deviation (or sample deviation if approximating) of a raster's band.
1. ST_StdDev(rast raster, nband int, ignore_nodata boolean) -> double
returns the standard deviation
nband: index of band to process on
ignore_nodata: if TRUE, any pixel who's value is nodata is ignored.
ST_StdDev(rast, 2, TRUE)
2. ST_StdDev(rast raster, nband int) -> double
assumes ignore_nodata = TRUE
ST_StdDev(rast, 2)
3. ST_StdDev(rast raster, ignore_nodata boolean) -> double
assumes band index = 1
ST_StdDev(rast, FALSE)
4. ST_StdDev(rast raster) -> double
assumes band index = 1 and ignore_nodata = TRUE
ST_StdDev(rast)
Four approximation functions are also proposed sacrificing some accuracy for speed, especially on large rasters (10000 x 10000).
1. ST_ApproxStdDev(rast raster, nband int, ignore_nodata boolean, sample_percent double precision) -> double
sample_percent: a value between 0 and 1 indicating the percentage of the raster band's pixels to consider in computing the summary stats.
ST_ApproxStdDev(rast, 3, FALSE, 0.1) ST_ApproxStdDev(rast, 1, TRUE, 0.5)
2. ST_ApproxStdDev(rast raster, ignore_nodata boolean, sample_percent double precision) -> double
assumes that nband = 1
ST_ApproxStdDev(rast, FALSE, 0.01) ST_ApproxStdDev(rast, TRUE, 0.025)
3. ST_ApproxStdDev(rast raster, sample_percent double precision) -> double
assumes that nband = 1 and ignore_nodata = TRUE
ST_ApproxStdDev(rast, 0.25)
4. ST_ApproxStdDev(rast raster) -> double
assumes that nband = 1, ignore_nodata = TRUE and sample_percent = 0.1
ST_ApproxStdDev(rast)

