<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000099">
    <div class="moz-cite-prefix">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
cite="mid:CANPxM8jiEK0PQFwBxj9JnM7L74hLk1H9X_Fhc+RdS9yGU3z+eg@mail.gmail.com"
      type="cite">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 moz-do-not-send="true"
                href="http://flavors.me/eloiribeiro" target="_blank">flavors.me/eloiribeiro</a><br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
</pre>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <meta http-equiv="CONTENT-TYPE" content="text/html;
        charset=ISO-8859-1">
      <title></title>
      <meta name="GENERATOR" content="OpenOffice.org 2.4 (Win32)">
      <meta name="AUTHOR" content="Alberto Pettazzi">
      <meta name="CREATED" content="20080707;17121566">
      <meta name="CHANGEDBY" content="Alberto Pettazzi">
      <meta name="CHANGED" content="20090629;9141230">
      <meta name="CHANGEDBY" content="Alberto Pettazzi">
      <meta name="CHANGEDBY" content="Alberto Pettazzi">
      <meta name="CHANGEDBY" content="Alberto Pettazzi">
      <meta name="CHANGEDBY" content="Alberto Pettazzi">
      <meta name="CHANGEDBY" content="Alberto Pettazzi">
      <meta name="CHANGEDBY" content="Alberto Pettazzi">
      <meta name="CHANGEDBY" content="Alberto Pettazzi">
      <style type="text/css">
        <!--
                @page { size: 21cm 29.7cm; margin: 2cm }
                P { margin-bottom: 0.21cm }
        -->
        </style>
      <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:
          +34-881-999646</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">alberto.pettazzi@meteogalicia.es</a></font></p>
      <p style="margin-bottom: 0cm"><br>
      </p>
    </div>
  </body>
</html>