Using the raster calculator

With the raster calculator, we can create a new raster layer based on the values in one or more rasters that are loaded in the current QGIS project. To access this, go to Raster | Raster Calculator. All available Raster Bands are presented in a list in the top-left corner of the dialog using the raster_name@band_number format.

Continuing from our previous exercise in which we created a slope raster, we can, for example, find areas at elevations above 1,000 meters and with a slope of less than 5 degrees using the following expression:

"srtm_05_01@1" > 1000 AND "slope@1" < 5

You might have to adjust the values depending on the dataset you are using. Check out the Accessing raster and vector layer statistics section ...

Get Learn QGIS - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.