Hi Marco, MapAlgebra taking multiple band or multiple raster is not implemented yet. You can however try the plpgsql prototype of two raster ST_Mapalgebra at:
http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql/st_mapalgebra.sql Just execute the .sql file in PostgreSQL/PostGIS and do something like: SELECT ST_MapAlgebra(ST_MapAlgebra(rast, 4, rast, 3, "rast1 - rast2", "32BSI"), ST_MapAlgebra(rast, 4, rast, 3, "rast1 + rast2", "32BSI"), "rast1 / rast2", "32BF") FROM your rastertable Be careful at the pixeltypes of the result of each ST_MapAlgebra call. Let me know how this works. Remember this is just a prototype (might be slow and buggy)... Pierre > how to access the specific bands to make st_mapalgebra calculate some new > raster? > > select st_mapalgebra(rast, '(4-3)/(4+3)') from foo; or select > st_mapalgebra(rast, > '(st_band(rast, 4)-st_band(rast, 3))/(st_band(rast, 4)+st_band(rast, 3))') > from foo; > > does not work > > Marco > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
