Thank you all! Solved.<br clear="all"><br>Eloi Ribeiro<br>GIS Analyst<br>39,45º -0,40º<br><a href="http://flavors.me/eloiribeiro" target="_blank">flavors.me/eloiribeiro</a><br>
<br><br><div class="gmail_quote">2012/7/11 Alberto Pettazzi <span dir="ltr"><<a href="mailto:alberto.pettazzi@meteogalicia.es" target="_blank">alberto.pettazzi@meteogalicia.es</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


  
    
  
  <div bgcolor="#FFFFFF" text="#000099">
    <div>Hi, <br>
      <br>
      I think you should do<br>
      <br>
      raster2=if(isnull(raster1),0,raster1)<br>
      <br>
      El 11/07/12 14:02, Eloi Ribeiro escribió:<br>
    </div>
    <blockquote type="cite"><div><div class="h5">Hi,<br clear="all">
      <br>
      I am trying to do something really simple but not finding the
      right way to do it.
      <div>
        <div>I need to convert nulls into zeros. I have done this:<br>
          <i>r.mapcalc "raster2 = if(raster1 = null(), 0, raster1)"  </i></div>
        <div><i>r.mapcalc "raster2 = if(raster1 == null(), 0, raster1)"
             </i><i><br>
          </i>
          <div>But this convert all cells into nulls.
            <div><br>
            </div>
            <div>I have tried another approach with r.reclass, rules:</div>
            <div>
              <div>
                null/null()/no data/nodata...=0</div>
              <div>1=1</div>
              <div>2=2</div>
              <div>3=2</div>
              <div>4=2</div>
              <div>5=2</div>
            </div>
            <div><br>
            </div>
            <div>No fun, all I get is an ERROR: null/null()/no
              data/nodata...=0 </div>
            <div><br>
            </div>
            <div>
              What I'm doing wrong?<br>
              <br>
              Eloi Ribeiro<br>
              GIS Analyst<br>
              39,45º -0,40º<br>
              <a href="http://flavors.me/eloiribeiro" target="_blank">flavors.me/eloiribeiro</a><br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><div class="im"><pre>_______________________________________________
grass-user mailing list
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
</pre>
    </div></blockquote>
    <br>
    <br>
    <div>-- <br>
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      <p style="margin-bottom:0cm"><font color="#000080">Alberto
          Pettazzi</font></p>
      <p style="margin-bottom:0cm"><br>
      </p>
      <p style="margin-bottom:0cm"><font color="#000080">MeteoGalicia -
          Departamento de Climatología y Observación</font></p>
      <p style="margin-bottom:0cm"><font color="#000080">Consellería
          de Medio Ambiente, Territorio e Infraestruturas </font>
      </p>
      <p style="margin-bottom:0cm"><font color="#000080">Rúa de
          Roma, 6</font></p>
      <p style="margin-bottom:0cm"><font color="#000080">15707 Santiago
          de
          Compostela. A Coruña</font></p>
      <p style="margin-bottom:0cm"><br>
      </p>
      <p style="margin-bottom:0cm"><font color="#000080">Teléfono:
          <a href="tel:%2B34-881-999646" value="+34881999646" target="_blank">+34-881-999646</a></font></p>
      <p style="margin-bottom:0cm"><br>
      </p>
      <p style="margin-bottom:0cm"><font color="#000080">e-mail:
          <a href="mailto:alberto.pettazzi@meteogalicia.es" target="_blank">alberto.pettazzi@meteogalicia.es</a></font></p>
      <p style="margin-bottom:0cm"><br>
      </p>
    </div>
  </div>

<br>_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
<br></blockquote></div><br>