<html style="direction: ltr;">
  <head>
    <meta content="text/html; charset=windows-1255"
      http-equiv="Content-Type">
    <style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
  </head>
  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="preferred-charset"
    bgcolor="#FFFFFF" text="#660000">
    <div class="moz-cite-prefix">On 11/07/2012 15:12, Alberto Pettazzi
      wrote:<br>
    </div>
    <blockquote cite="mid:4FFD6DA2.3040709@meteogalicia.es" type="cite">
      <meta content="text/html; charset=windows-1255"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Hi, <br>
        <br>
        I think you should do<br>
        <br>
        raster2=if(isnull(raster1),0,raster1)<br>
        <br>
      </div>
    </blockquote>
    <br>
    or simply:<br>
    r.null raster1 null=0<br>
    (converts the original, not a second copy)<br>
    <br>
    <blockquote cite="mid:4FFD6DA2.3040709@meteogalicia.es" type="cite">
      <div class="moz-cite-prefix"> 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 moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a moz-do-not-send="true" 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=windows-1255">
        <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
              moz-do-not-send="true"
              href="mailto:alberto.pettazzi@meteogalicia.es">alberto.pettazzi@meteogalicia.es</a></font></p>
        <p style="margin-bottom: 0cm"><br>
        </p>
      </div>
      <br>
      <br>
      This mail was received via Mail-SeCure System.<br>
      <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>

This mail was received via Mail-SeCure System.


</pre>
    </blockquote>
    <font size="+1"></font><br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Micha Silver
052-3665918
</pre>
  </body>
</html>