[Qgis-user] Raster calculation: if Layer1 is > 1, then Layer2 should be 0

Sebastian Gutwein bas at rdgland.com
Thu Feb 17 13:19:45 PST 2022


Reclassify your Layer 1 to be anything greater than 1 = 0 everything else
equals 1. This will give you a binary 1 and 0 raster (Layer 3)  that you
can use in the raster calculator: Layer 2 * Layer 3.  Anywhere where layer
3 is 1 your layer 2 values will stay the same and anywhere where layer 3 is
0 your layer 2 values will become 0.

On Thu, Feb 17, 2022 at 3:19 PM Bernd Vogelgesang <bernd.vogelgesang at gmx.de>
wrote:

> Hi folk,
>
> I hardly never work with raster calculations, and unfortunately there is
> nowhere a collection of syntax examples for different use cases to be found
> (documentation :( ).
>
> Anything apart from +-*/ is beyond my scope.
>
> So,
>
> I made a viewshed analysis over a digital surface model (try the awesome
> Visibility Analysis plugin form Zoran Čučković and buy him a beer!)
>
> A lot of "views" are caught by tree canopy, but I am only interest in the
> flat grounds.
>
> So I substracted the surface model layer from the ground model layer, and
> this is Layer 1.
>
> Giving a threshold of 1 meters difference for inaccuracities, all pixels
> in this layer above 1 should result in 0 (zero) in my viewshed raster
> (Layer 2)
>
> Please give me some hints,
>
> Cheers,
>
> Bernd
>
>
> <contact at zoran-cuckovic.from.hr>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220217/a9f153e0/attachment.html>


More information about the Qgis-user mailing list