:)  how difficult, isn&#39;t it?<br><br>Thanks!<br><br>But there is no way to avoid r.mapcalc, is there?<br><br><br><br><div class="gmail_quote">On Thu, Dec 8, 2011 at 8:04 PM, Moritz Lennert <span dir="ltr">&lt;<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 08/12/11 22:26, Marcello Gorini wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Dear all,<br>
<br>
Inside a loop in a shell script, I keep incrementing the values of a raster<br>
map using r.mapcalc with some logical expressions.<br>
<br>
Therefore, I need to initialize the raster map before the loop itself.<br>
Ideally, I would like to initialize it as a raster with the same dimensions<br>
as my base map, but containing only zeros.<br>
<br>
In order to do that, I use the following expression:<br>
<br>
r.mapcalc &quot;initialized_map=if(base_map&gt;<u></u>999999,1,0)&quot;<br>
<br>
Besides being one of the ugliest pieces of code one could ever write, it<br>
also incurs in waste of processing time.<br>
<br>
Which would be a more elegant and optimized way of initializing these raster<br>
maps?<br>
<br>
Thanks in advance for any thoughts you could share.<br>
</blockquote>
<br></div>
g.region rast=YourBaseMap<br>
r.mapcalc initialized_map=0<span class="HOEnZb"><font color="#888888"><br>
<br>
Moritz<br>
</font></span></blockquote></div><br>