[postgis-devel] [PostGIS] #932: [raster] ST_StdDev

PostGIS trac at osgeo.org
Fri Apr 29 11:01:55 PDT 2011


#932: [raster] ST_StdDev
----------------------------+-----------------------------------------------
 Reporter:  dustymugs       |       Owner:  dustymugs            
     Type:  task            |      Status:  new                  
 Priority:  medium          |   Milestone:  PostGIS Raster Future
Component:  postgis raster  |     Version:  trunk                
 Keywords:                  |  
----------------------------+-----------------------------------------------
 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)
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/932>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list