On Sat, Apr 11, 2009 at 10:00 PM, Margherita Di Leo <direg...@gmail.com> wrote: > Hi all, > > i'm in trouble using r.mapcalc in Grass 6.5 svn > > In order to replace in a raster map (basin_10m) the values 24,26 with 28, i > use the following cmd line: > > r.mapcalc 'basin_10m_2=if(basin_10m==24),28' > r.mapcalc 'basin_10m_2=if(basin_10m==26),28'
You need to set the braces correctly (personally, I use double quotes to be able to use shell variables). Also better define the "else" part: if(condition, then, else) so r.mapcalc "basin_10m_2=if(basin_10m==24, 28, null())" r.mapcalc "basin_10m_3=if(basin_10m==26, 28, null())" Note that I changed the second map name to _3 otherwise it would overwrite the first. You can also combine conditions, e.g.: if(condition1 && condition2, then, else) cheers Markus _______________________________________________ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user