[postgis-devel] [PostGIS] #931: [raster] ST_Mean

PostGIS trac at osgeo.org
Fri Apr 29 10:58:18 PDT 2011


#931: [raster] ST_Mean
----------------------------+-----------------------------------------------
 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 arithmetic mean of a raster's band.

 1. ST_Mean(rast raster, nband int, ignore_nodata boolean) -> double

     returns the mean

     nband: index of band to process on

     ignore_nodata: if TRUE, any pixel who's value is nodata is ignored.

 {{{
 ST_Mean(rast, 2, TRUE)
 }}}

 2. ST_Mean(rast raster, nband int) -> double

     assumes ignore_nodata = TRUE

 {{{
 ST_Mean(rast, 2)
 }}}

 3. ST_Mean(rast raster, ignore_nodata boolean) -> double

     assumes band index = 1

 {{{
 ST_Mean(rast, FALSE)
 }}}

 4. ST_Mean(rast raster) -> double

     assumes band index = 1 and ignore_nodata = TRUE

 {{{
 ST_Mean(rast)
 }}}

 Four approximation functions are also proposed sacrificing some accuracy
 for speed, especially on large rasters (10000 x 10000).

 1. ST_ApproxMean(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 when determining the min/max pair.

 {{{
 ST_ApproxMean(rast, 3, FALSE, 0.1)

 ST_ApproxMean(rast, 1, TRUE, 0.5)
 }}}

 2. ST_ApproxMean(rast raster, ignore_nodata boolean, sample_percent double
 precision) -> double

     assumes that nband = 1

 {{{
 ST_ApproxMean(rast, FALSE, 0.01)

 ST_ApproxMean(rast, TRUE, 0.025)
 }}}

 3. ST_ApproxMean(rast raster, sample_percent double precision) -> double

     assumes that nband = 1 and ignore_nodata = TRUE

 {{{
 ST_ApproxMean(rast, 0.25)
 }}}

 4. ST_ApproxMean(rast raster) -> double

     assumes that nband = 1, ignore_nodata = TRUE and sample_percent = 0.1

 {{{
 ST_ApproxMean(rast)
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/931>
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