Doesn’t the second example (One raster, several bands) similar to your case in 
the doc?

http://postgis.net/docs/RT_ST_MapAlgebra.html

Pierre

From: postgis-users [mailto:[email protected]] On Behalf Of 
David Haynes
Sent: Tuesday, November 17, 2015 9:48 AM
To: [email protected]
Subject: [postgis-users] Raster calculation on 3d raster (stack)

Hello,

I have a mulibanded raster and I am wondering if I can apply any of the raster 
processing functions (min, max, mean, stdev) to multibanded rasters. 
Specifically, I am wondering if these functions will be able to applied to the 
z-axis.

Here is an example, I have worked up in python starting with two 2d arrays.
x = [[1,4,5,6], [3,5,6,2]]
z = [[2,7,8,9], [8,3,5,9]]
convert to np.array
y = np.dstack((np.array(x), np.array(z)))
>>> y.sum(2)
array([[ 3, 11, 13, 15],
       [11,  8, 11, 11]])

I want to apply the raster processing functions to the z-axis and I am 
wondering if I can do it in PostGIS? It seems like the mapalgebra call back 
functions could do this, but I am having difficulty finding an example.
_______________________________________________
postgis-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to