> SELECT
>       ST_MapAlgebraExpr(a.rast, 4, b.rast, 3, '(a.rast - b.rast) /(a.rast +
> b.rast)::float')
> FROM
>       nclraster1 a, nclraster1 b;
> 
> instead of rast1 - rast2 etc.
> 
> Returns an error of
> ERROR:  missing FROM-clause entry for table "a"
> LINE 1: SELECT ((a.rast - b.rast) /(a.rast + b.rast)::float)::double...
> 
> Can anyone explain this?

In the expression, you don't refer to the pixels of a.rast with "a.rast" but 
with "rast1". so your query should be:

SELECT  ST_MapAlgebraExpr(a.rast, 4, b.rast, 3, '(rast1 - rast2) /(rast1 + 
rast2)::float') FROM nclraster1 a, nclraster1 b;

Pierre
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to