<div dir="ltr">Your expression is not using the correct placeholders. It should look something like:<br><br>...<br>ST_MapAlgebraExpr(a.maxrast,b.minrast,'[rast1.val] * [rast2.val]', 'INTERSECTION', 'NULL', 'NULL', 'NULL') as rast from max_rast a, min_rast b<br>

<br><br><br>On Tue, Sep 10, 2013 at 12:36 PM, <<a href="mailto:g.singh@utwente.nl">g.singh@utwente.nl</a>> wrote:<br>><br>> Dear Postgis Community,<br>><br>>  <br>><br>> I have two rasters and I want to create new raster using intersection through ST_MapALgepraExpre() function. The new raster should have pixel values as max pixel values from either of the two rasters. I guess that I want to use product of these two rasters for what I want in new raster. I use following query and encounter the problem. I am sure there is something wrong in my query with expression. Can someone please guide me how to correct it. My Postgis version is of data "2012-03-29 09:07:33" and raster lib build data "2012-03-29 09:07:33"<br>

><br>>  <br>><br>> With env as(<br>><br>> select rid, gaztext_id, st_area(ST_Envelope(rast)) as area, rast from text_rast_intersection ),<br>><br>> max_rast as(select e.rid, e.gaztext_id, e.rast as maxrast from env e, env b where e.area > b.area )<br>

><br>> ,min_rast as (select e.rid, e.gaztext_id, e.rast as minrast from env e, env b where e.area < b.area )<br>><br>> select '222' as rid, 964 as gaztext_id,<br>><br>> st_MapAlgebraExpr(a.maxrast,b.minrast,'minrast'*'mnaxrast', 'INTERSECTION', 'NULL', 'NULL', 'NULL') as rast from max_rast a, min_rast b<br>

><br>>  <br>><br>> ERROR:<br>><br>> ERROR:  operator is not unique: unknown * unknown<br>><br>> LINE 14: st_MapAlgebraExpr(a.maxrast,b.minrast,'minrast'*'mnaxrast', ...<br>><br>
>                                                         ^<br>
><br>> HINT:  Could not choose a best candidate operator. You might need to add explicit type casts.<br>><br>>  <br>><br>> ********** Error **********<br>><br>>  <br>><br>> ERROR: operator is not unique: unknown * unknown<br>

><br>> SQL state: 42725<br>><br>> Hint: Could not choose a best candidate operator. You might need to add explicit type casts.<br>><br>> Character: 468<br>><br>>  <br>><br>>  <br>><br>> Thanks,<br>

><br>> Gaurav<br>><br>>  <br>><br>><br>> _______________________________________________<br>> postgis-users mailing list<br>> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>

> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></div>