[postgis-users] Raster pixel value

Andreas Forø Tollefsen andreasft at gmail.com
Fri Nov 25 00:32:26 PST 2011


Hi,

Thanks for all of the suggestions. I will do some more testing. However, as
for suggestion 1 i think the pixel size should be the same as the original
raster or am I wrong?

Both the mean_mnt_bin raster and the priogrid_land shapefile can be
downloaded as zip (2 mb) here:
http://gisintersect.com/mean_mnt_bin.zip
http://gisintersect.com/priogrid_land.zip

Any help on getting the correct values would be very much appreciated.

My query:
DROP TABLE IF EXISTS mountain_cell;

SELECT
a.gid As id,
(ST_SummaryStats((ST_Union(ST_MapAlgebraExpr(ST_AsRaster(a.cell, b.rast,
'32BF'), b.rast, 'rast2', '32BF','INTERSECTION','0','0',0))).rast,
false)).mean As avgmnt
INTO mountain_cell
FROM
priogrid_land a LEFT JOIN
mountain b
    ON ST_Intersects(a.cell, b.rast)
GROUP BY a.gid
ORDER BY a.gid;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111125/84f519b6/attachment.html>


More information about the postgis-users mailing list