[postgis-users] ST_Mapalgebraexpr requires same alignment

Jose Carlos Martinez jomarlla at cgf.upv.es
Thu Mar 22 10:00:58 PDT 2012

Hi. Im trying to use mapalgebra between two layers with tiles, I get 
this warning:
NOTICE:  The two rasters provided do not have the same alignment.  
Returning NULL

The resulted tiles are empty. Does ST_Mapalgebraexpr  require same 
alignment? According to the docs I guess not but then dont know why im 
getting that message.
In another example I didnt use st_union with the same result.

insert into demdif (rast) select st_mapalgebraexpr (d1.rast, 1, st_union 
(d2.rast),  1, 'abs([rast1.val] - [rast2-val])','16BSI', 'FIRST', null, 
null,null) from dem200 d1, dem d2 where d1.rast && d2.rast and st_relate 
(d1.rast::geometry, d2.rast::geometry, 'T********') group by d1.rid;

Another issue is st_union (internally is st_mapalgebraexpr) is extremely 
slow. I can not manage raster layers bigger than a couple of thousand 
pixel in x or y even with 128 tiled blocks.


More information about the postgis-users mailing list