Ticket #986 (closed task: fixed)
[raster] ST_Sum
| Reported by: | dustymugs | Owned by: | dustymugs |
|---|---|---|---|
| Priority: | medium | Milestone: | PostGIS 2.0.0 |
| Component: | raster | Version: | trunk |
| Keywords: | history | Cc: |
Description
This function calls ST_SummaryStats and only returns the sum from that function.
1. ST_Sum(rast raster, nband int, hasnodata boolean) -> double precision
returns the sum as an integer
nband: index of band
hasnodata: if FALSE, any pixel who's value is nodata is ignored
ST_Sum(rast, 1, FALSE)
2. ST_Sum(rast raster, nband int) -> double precision
assumes hasnodata = TRUE
ST_Sum(rast, 2)
3. ST_Sum(rast raster, hasnodata boolean) -> double precision
assumes nband = 1
ST_Sum(rast, TRUE)
4. ST_Sum(rast raster) -> double precision
assumes nband = 1 and hasnodata = TRUE
ST_Sum(rast)
The set of ST_ApproxSum functions are:
1. ST_ApproxSum(rast raster, nband int, hasnodata boolean, sample_percent double precision) -> double precision
sample_percent: a value between 0 and 1 indicating the percentage of the raster band's pixels to consider
ST_ApproxSum(rast, 3, FALSE, 0.1) ST_ApproxSum(rast, 1, TRUE, 0.5)
2. ST_ApproxSum(rast raster, nband int, sample_percent double precision) -> double precision
assumes that nband = 1
ST_ApproxSum(rast, 2 0.01) ST_ApproxSum(rast, 4, 0.025)
3. ST_ApproxSum(rast raster, hasnodata boolean, sample_percent double precision) -> double precision
assumes that nband = 1
ST_ApproxSum(rast, FALSE, 0.01) ST_ApproxSum(rast, TRUE, 0.025)
4. ST_ApproxSum(rast raster, sample_percent double precision) -> double precision
assumes that nband = 1 and hasnodata = TRUE
ST_ApproxSum(rast, 0.25)
5. ST_ApproxSum(rast raster) -> double precision
assumes that nband = 1, hasnodata = TRUE and sample_percent = 0.1
ST_ApproxSum(rast)
The following functions are provided for coverage tables.
1. ST_Sum(rastertable text, rastercolumn text, nband int, hasnodata boolean) -> double precision
rastertable: name of table with raster column
rastercolumn: name of column of data type raster
ST_Sum('tmax_2010', 'rast', 1, FALSE)
ST_Sum('precip_2011', 'rast', 1, TRUE)
2. ST_Sum(rastertable text, rastercolumn text, nband int) -> double precision
hasnodata = TRUE
ST_Sum('tmax_2010', 'rast', 1)
3. ST_Sum(rastertable text, rastercolumn text, hasnodata boolean) -> double precision
nband = 1
ST_Sum('precip_2011', 'rast', TRUE)
4. ST_Sum(rastertable text, rastercolumn text) -> double precision
nband = 1 and hasnodata = TRUE
ST_Sum('tmin_2009', 'rast')
Variations for ST_ApproxSum are:
1. ST_ApproxSum(rastertable text, rastercolumn text, nband int, hasnodata boolean, sample_percent double precision) -> double precision
ST_ApproxSum('tmax_2010', 'rast', 1, FALSE, 0.5)
ST_ApproxSum('precip_2011', 'rast', 1, TRUE, 0.2)
2. ST_ApproxSum(rastertable text, rastercolumn text, nband int, sample_percent double precision) -> double precision
hasnodata = TRUE
ST_ApproxSum('tmax_2010', 'rast', 1, 0.5)
ST_ApproxSum('precip_2011', 'rast', 1, 0.2)
3. ST_ApproxSum(rastertable text, rastercolumn text, hasnodata boolean, sample_percent double precision) -> double precision
nband = 1
ST_ApproxSum('tmax_2010', 'rast', FALSE, 0.5)
ST_ApproxSum('precip_2011', 'rast', TRUE, 0.2)
4. ST_ApproxSum(rastertable text, rastercolumn text, sample_percent double precision) -> double precision
nband = 1 and hasnodata = TRUE
ST_ApproxSum('tmax_2010', 'rast', 0.5)
ST_ApproxSum('precip_2011', 'rast', 0.2)
5. ST_ApproxSum(rastertable text, rastercolumn text) -> double precision
nband = 1, hasnodata = TRUE and sample_percent = 0.1
ST_ApproxSum('tmax_2010', 'rast')
ST_ApproxSum('precip_2011', 'rast')
