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:
Open the Change grid values algorithm from the Processing Toolbox menu. Set the Replace condition parameter to Low Value <= Grid Value < High Value.
Click on the button in the Lookup table parameter and fill the table that will appear, as shown in the following screenshot:
Run the algorithm. This will create the reclassified layer:
How it works…
Values for each cell are compared with the range limits in the lookup table, considering the specified comparison criteria. Whenever a value falls into a given range, the class value specified for this range will be used in the output...