[postgis-users] Extracting cell values into a matrix

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Tue Jul 3 10:22:54 PDT 2012


> I need to do an ordered weighted averaging with the input rasters: assuming
> they all have the same extension and characteristics (like pixel size), for
> position (1,1) I take the value of every raster, the I sort those values to
> assign the weights and finally I compute the average to store it in the
> (1,1) position of the output raster. And so on with the rest of the
> positions.

How many overlapping raster do you have? How do you determine the right weight?

ST_Union can compute the mean of many overlapping rasters. Maybe a simple modification of the code (it is written in plpgsql) would do what you want. If there are not so many overlaping raster ST_MapAlgebra(raster, raster) could also be used depending on how you determine the right weight.

Pierre



More information about the postgis-users mailing list