<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi All,<br>
<br>
I am hoping somebody can help me with a query. I have a table of
rasters where each record is date ("obs_date") and raster containing
a risk value of 0 or 1. My easy, successful query to accumulate
the risk values over the previous 60 days is:<br>
<br>
INSERT INTO accum_risk (obs_date, rast)<br>
SELECT '1979-07-15', ST_Union(rast,'SUM')<br>
FROM daily_risk<br>
WHERE obs_date BETWEEN '1979-05-16' AND '1979-07-15';<br>
<br>
My final goal--for which I am asking help--is similar to the above
query, but it will reference another raster table. This table has
for each grid cell a value for the day of year (DOY) from which the
60 day accumulation should be made. Conceptually:<br>
<br>
FOR EACH doy_cell IN doy_raster<br>
SELECT ST_Union(rast,'SUM')<br>
FROM daily_risk<br>
WHERE obs_date BETWEEN doy-60 AND doy;<br>
<br>
Any help is greatly appreciated.<br>
<br>
Thanks,<br>
Steve<br>
<pre class="moz-signature" cols="72">--
Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University
<a class="moz-txt-link-abbreviated" href="mailto:src176@psu.edu">src176@psu.edu</a>
</pre>
</body>
</html>