[postgis-users] Problem with ST_MapAlgebraExpr

g.singh at utwente.nl g.singh at utwente.nl
Tue Sep 10 12:36:47 PDT 2013


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130910/b05379a9/attachment.html>


More information about the postgis-users mailing list