I'm getting the following error from a query that I'm running on a raster and polygon:<br><br>pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: column "rast1" does not exist<br>
LINE 1: SELECT (rast1)::double precision<br> ^<br>QUERY: SELECT (rast1)::double precision<br>CONTEXT: PL/pgSQL function "st_clip" line 42 at assignment in 'filename'. <br><br>My query is as follows:<br>
<br>SELECT<br> band,<br> SUM((stats).sum) as sum,<br> SUM((stats).count) as count,<br> AVG((stats).mean) as avg <br> FROM (<br> SELECT<br> band,<br>
ST_SummaryStats(ST_Clip(r.rast, band,p.geom, NULL, TRUE)) as stats<br> FROM <br> generate_series(1,5) AS band,<br> raster AS r<br> polygon AS p<br>
WHERE <br> ST_Intersects(r.rast, p.geom) <br> ) AS<br> foo<br> GROUP BY<br> band<br> ORDER BY<br>
band;<br><br>I did recently upgrade to the newest version of PostGIS on Windows, but I'm not certain if this is the cause. I'm most unclear about the part: "(rast1)::double precision" Do I need to be specifying the type of raster in the query? The values are all integers in this case.<br>
<br>Thanks,<br>David<br>