[postgis-users] ST_Mapalgebraexpr requires same alignment

Jose Carlos Martinez jomarlla at cgf.upv.es
Fri Mar 23 10:12:33 PDT 2012


Following Pierre notes I can do (note st_resample):

s1=# insert into demdif (rast) select st_mapalgebraexpr (d1.rast, 1, 
st_resample (st_union (d2.rast), d1.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;

Its not the best way to do but at least we can mix different layers.
Thanks Pierre,
Jose

On 23/03/2012 17:32, Jose Carlos Martinez wrote:
> On 23/03/2012 17:12, Paul Ramsey wrote:
>> On Fri, Mar 23, 2012 at 8:16 AM, Jose Carlos Martinez
>> <jomarlla at cgf.upv.es>  wrote:
>>
>>> ummm...there is some plans about future releases to work with not 
>>> alignment
>>> rasters? to be honest I think this is a limitation in order to to 
>>> carry out
>>> a normal raster spatial analysis. :-(. I will try to use postgis raster
>>> without this feature though.
>> I don't think it's unreasonable to expect that inputs to mapalgebras
>> be on the same alignment. I do thing that utilities for re-sampling
>> whole tables need to exist to that it's possible to run full analyses
>> inside the database, but I think requiring alignment for mapalgebra
>> will solve more problems (in terms of people getting the results they
>> "expect") than trying to plaster over it with automagical code.
> I m not sure If i understand you because of english but what Im 100% 
> sure is that any person who has made raster spatial analysis with real 
> data knows that map algebra must work with raster with different 
> alignment as other software do. The normal thing if I have raster 
> layers from different sources is that they dont have same alignment, 
> as I said so for any raster software that I know can work with these 
> kind of data, thats why Im guessing PostGIS raster is working with 
> pixels and not with terrain coordinates (but maybe Im wrong).
>
> Please dont think in a computer science expertise way and think as if 
> you were a geographer who just want to mix two raster layers and dont 
> mind if they layers have same alignment or not. Otherwise people are 
> going to keep using sextante, arcgis, grass, etc. instead of PostGIS 
> Raster.
>
>
>
>>
>> P.
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list