Modifying and reclassifying values in raster layers

A very useful technique to work with raster data is changing their values or grouping them into categories. In this recipe, we will see how to do this.

Getting ready

Open the DEM file that we used in previous recipes.

How to do it…

We will classify the elevation in three groups:

  • Lower than 1,000m
  • Between 1,000 and 2,000m
  • Higher than 2,000m

To do this, follow these steps:

  1. Open the Change grid values algorithm from the Processing Toolbox menu. Set the Replace condition parameter to Low Value <= Grid Value < High Value.
  2. Click on the button in the Lookup table parameter and fill the table that will appear, as shown in the following screenshot:
  3. Run the algorithm. This will create the reclassified layer:

How it ...

Get QGIS: Becoming a GIS Power User now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.