[postgis-devel] [PostGIS] #930: [raster] ST_SummaryStats

PostGIS trac at osgeo.org
Fri Apr 29 10:53:57 PDT 2011


#930: [raster] ST_SummaryStats
----------------------------+-----------------------------------------------
 Reporter:  dustymugs       |       Owner:  dustymugs            
     Type:  task            |      Status:  new                  
 Priority:  medium          |   Milestone:  PostGIS Raster Future
Component:  postgis raster  |     Version:  trunk                
 Keywords:                  |  
----------------------------+-----------------------------------------------
 Like how ST_AsGDALRaster is the backend to ST_AsTIFF, ST_AsJPEG and
 ST_AsPNG, ST_SummaryStats is the backend for several summary stats:

 1. Count of the population/sample included in the stats

 2. Mean (ST_Mean or is ST_Average better?)

 3. Standard Deviation (ST_StdDev)

 4. !Min/Max (ST_MinMax)

 The proposed variations are:

 1. ST_SummaryStats(rast raster, nband int, ignore_nodata boolean) ->
 record

     returns one record of five columns (count, mean, stddev, min, max)

     nband: index of band to process on

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

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

 2. ST_SummaryStats(rast raster, nband int) -> record

     assumes ignore_nodata = TRUE

 {{{
 ST_SummaryStats(rast, 2)
 }}}

 3. ST_SummaryStats(rast raster, ignore_nodata boolean) -> record

     assumes band index = 1

 {{{
 ST_SummaryStats(rast, FALSE)
 }}}

 4. ST_SummaryStats(rast raster) -> record

     assumes band index = 1 and ignore_nodata = TRUE

 {{{
 ST_SummaryStats(rast)
 }}}

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

 1. ST_SummaryStats(rast raster, nband int, ignore_nodata boolean,
 sample_percent double precision) -> record

     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_SummaryStats(rast, 3, FALSE, 0.1)

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

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

     assumes that nband = 1

 {{{
 ST_SummaryStats(rast, FALSE, 0.01)

 ST_SummaryStats(rast, TRUE, 0.025)
 }}}

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

     assumes that nband = 1 and ignore_nodata = TRUE

 {{{
 ST_SummaryStats(rast, 0.25)
 }}}

 4. ST_SummaryStats(rast raster) -> record

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

 {{{
 ST_SummaryStats(rast)
 }}}

 New tickets for ST_Mean and ST_StdDev will be posted next.

 Functions that can depend upon the basic stats (ST_Histogram and
 ST_Quantile) will be proposed later.

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