:) how difficult, isn't it? Thanks!
But there is no way to avoid r.mapcalc, is there? On Thu, Dec 8, 2011 at 8:04 PM, Moritz Lennert <mlenn...@club.worldonline.be > wrote: > On 08/12/11 22:26, Marcello Gorini wrote: > >> Dear all, >> >> Inside a loop in a shell script, I keep incrementing the values of a >> raster >> map using r.mapcalc with some logical expressions. >> >> Therefore, I need to initialize the raster map before the loop itself. >> Ideally, I would like to initialize it as a raster with the same >> dimensions >> as my base map, but containing only zeros. >> >> In order to do that, I use the following expression: >> >> r.mapcalc "initialized_map=if(base_map>**999999,1,0)" >> >> Besides being one of the ugliest pieces of code one could ever write, it >> also incurs in waste of processing time. >> >> Which would be a more elegant and optimized way of initializing these >> raster >> maps? >> >> Thanks in advance for any thoughts you could share. >> > > g.region rast=YourBaseMap > r.mapcalc initialized_map=0 > > Moritz >
_______________________________________________ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user