[Qgis-user] unable to produce a raster mask

Giuseppe Sucameli brush.tyler at gmail.com
Sun Nov 23 15:20:48 PST 2014


Ciao Giacomo,

the condition ( "lc_n_italy1 at 1" >= 8 ) is evaluated to either 1 or 0
depending on the lc_n_italy1 at 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 at 1" < 8 ) * "lc_n_italy1 at 1

Best regards.
Giuseppe


On Sat, Nov 22, 2014 at 11:34 AM, Giacomo Fontanelli <
giacomofontanelli76 at 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 at 1" >= 8 )  * ("lc_n_italy1 at 1" * 0)
>
> I tried also
>
>  ( "lc_n_italy1 at 1" >= 8 )  * 0
>
> but I always obtain a map with only "Nan"
>
> Can you help me?
>
> Thank you
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>



-- 
Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20141124/21b332ef/attachment.html>


More information about the Qgis-user mailing list