[postgis-users] Raster calculation on 3d raster (stack)

David Haynes haynesd2 at gmail.com
Tue Nov 17 06:47:58 PST 2015


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20151117/55d12626/attachment.html>


More information about the postgis-users mailing list