[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qgis-user
Subject:    Re: [Qgis-user] unable to produce a raster mask
From:       Giacomo <giacomofontanelli76 () gmail ! com>
Date:       2014-11-30 12:40:09
Message-ID: 547B1029.9080206 () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Dear Giuseppe

First I have to apologize for the big delay I used to reply you.

Your hint was correct and the map is done.

Thank you very much again!

Spero di rivederti presto.

Giacomo
On 24/11/2014 00:20, Giuseppe Sucameli wrote:
> Ciao Giacomo,
>
> the condition ( "lc_n_italy1@1" >= 8 ) is evaluated to either 1 or 0 
> depending on the lc_n_italy1@1 value.
> so you always get 0 (!) as the second factor is always 0.
>
> Try to set the formula to the following:
> ( "lc_n_italy1@1" < 8 ) * "lc_n_italy1@1
>
> Best regards.
> Giuseppe
>
>
> On Sat, Nov 22, 2014 at 11:34 AM, Giacomo Fontanelli 
> <giacomofontanelli76@gmail.com <mailto:giacomofontanelli76@gmail.com>> 
> wrote:
>
>     Dear community
>
>     I start from a raster layer, 8bit unsigned integer. Pixel value
>     ranges from 1 to 12.
>
>     I would like to mask the pixels with value>8, setting their new
>     value to 0.
>
>     I used raster calculator with this formula
>
>      ( "lc_n_italy1@1" >= 8 )  * ("lc_n_italy1@1" * 0)
>
>     I tried also
>
>      ( "lc_n_italy1@1" >= 8 )  * 0
>
>     but I always obtain a map with only "Nan"
>
>     Can you help me?
>
>     Thank you
>
>     _______________________________________________
>     Qgis-user mailing list
>     Qgis-user@lists.osgeo.org <mailto:Qgis-user@lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
>
> -- 
> Giuseppe Sucameli


[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Dear Giuseppe<br>
    <br>
    First I have to apologize for the big delay I used to reply you.<br>
    <br>
    Your hint was correct and the map is done.<br>
    <br>
    Thank you very much again!<br>
    <br>
    Spero di rivederti presto.<br>
    <br>
    Giacomo<br>
    <div class="moz-cite-prefix">On 24/11/2014 00:20, Giuseppe Sucameli
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAA6k8-Km6hXDGfvXc+qaMkEuNc7wd5NhGO1JQD5KDU-Tekqdvg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Ciao Giacomo, <br>
        </div>
        <div><br>
        </div>
        <div>the condition ( "lc_n_italy1@1" &gt;= 8 ) is evaluated to
          either 1 or 0 depending on the lc_n_italy1@1 value.<br>
        </div>
        <div>so you always get 0 (!) as the second factor is always 0.<br>
        </div>
        <div><br>
        </div>
        <div>Try to set the formula to the following:<br>
        </div>
        <div>( "lc_n_italy1@1" &lt; 8 ) * "lc_n_italy1@1</div>
        <div><br>
          Best regards.<br>
        </div>
        <div>Giuseppe<br>
          <br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sat, Nov 22, 2014 at 11:34 AM,
          Giacomo Fontanelli <span dir="ltr">&lt;<a
              moz-do-not-send="true"
              href="mailto:giacomofontanelli76@gmail.com"
              target="_blank">giacomofontanelli76@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Dear community
              <div><br>
              </div>
              <div>I start from a raster layer, 8bit unsigned integer.
                Pixel value ranges from 1 to 12.</div>
              <div><br>
              </div>
              <div>I would like to mask the pixels with value&gt;8,
                setting their new value to 0.</div>
              <div><br>
              </div>
              <div>I used raster calculator with this formula</div>
              <div><br>
              </div>
              <div> ( "lc_n_italy1@1" &gt;= 8 )  * ("lc_n_italy1@1" * 0)<br>
              </div>
              <div><br>
              </div>
              <div>I tried also </div>
              <div><br>
              </div>
              <div> ( "lc_n_italy1@1" &gt;= 8 )  * 0<br>
              </div>
              <div><br>
              </div>
              <div>but I always obtain a map with only "Nan"</div>
              <div><br>
              </div>
              <div>Can you help me?</div>
              <div><br>
              </div>
              <div>Thank you</div>
            </div>
            <br>
            _______________________________________________<br>
            Qgis-user mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.osgeo.org/mailman/listinfo/qgis-user"
              target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <div class="gmail_signature">Giuseppe Sucameli</div>
      </div>
    </blockquote>
    <br>
  </body>
</html>


_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic