[postgis-users] Problem with ST_MapAlgebraExpr

Bborie Park dustymugs at gmail.com
Tue Sep 10 13:27:08 PDT 2013


Your expression is not using the correct placeholders. It should look
something like:

...
ST_MapAlgebraExpr(a.maxrast,b.minrast,'[rast1.val] * [rast2.val]',
'INTERSECTION', 'NULL', 'NULL', 'NULL') as rast from max_rast a, min_rast b



On Tue, Sep 10, 2013 at 12:36 PM, <g.singh at utwente.nl> wrote:
>
> Dear Postgis Community,
>
>
>
> 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"
>
>
>
> With env as(
>
> select rid, gaztext_id, st_area(ST_Envelope(rast)) as area, rast from
text_rast_intersection ),
>
> max_rast as(select e.rid, e.gaztext_id, e.rast as maxrast from env e, env
b where e.area > b.area )
>
> ,min_rast as (select e.rid, e.gaztext_id, e.rast as minrast from env e,
env b where e.area < b.area )
>
> select '222' as rid, 964 as gaztext_id,
>
> st_MapAlgebraExpr(a.maxrast,b.minrast,'minrast'*'mnaxrast',
'INTERSECTION', 'NULL', 'NULL', 'NULL') as rast from max_rast a, min_rast b
>
>
>
> ERROR:
>
> ERROR:  operator is not unique: unknown * unknown
>
> LINE 14: st_MapAlgebraExpr(a.maxrast,b.minrast,'minrast'*'mnaxrast', ...
>
>                                                         ^
>
> HINT:  Could not choose a best candidate operator. You might need to add
explicit type casts.
>
>
>
> ********** Error **********
>
>
>
> ERROR: operator is not unique: unknown * unknown
>
> SQL state: 42725
>
> Hint: Could not choose a best candidate operator. You might need to add
explicit type casts.
>
> Character: 468
>
>
>
>
>
> Thanks,
>
> Gaurav
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130910/1fc5a5b5/attachment.html>


More information about the postgis-users mailing list