[postgis-users] raster aggregate functions - mean band

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Mon Apr 2 07:17:32 PDT 2012


> I got a raster table with 30 rasters, each raster represents one day including
> bands with temperature-values.
> 
> Is there a possibility to get the mean of all the values of band1 from all rasters
> with an aggregate-function like:
> 
> SELECT MEAN_BAND(band1, rast) AS new_band FROM table;
> 
> I tried to find something like that but I could just find MapAlgebra-functions
> using up to 2 rasters as input.

Put all your raster (not tiled) in the same table and do:

SELECT ST_Union(rast, 'MEAN')
FROM yourrasttable

This might be slow if your rasters are big.

Pierre


More information about the postgis-users mailing list