Performing supervised classification of raster layers
In the previous recipes, we saw how to change the values of a raster layer and create classes. When you have several layers, classifying might not be that easy, and defining the patterns to perform this classification might not be obvious. A different technique to be used in this case is to define zones that share a common characteristic and let the corresponding algorithm extract the statistical values that define them so that this can later be applied to perform the classification itself. This is known as Supervised classification, and this recipe explains how to do this in QGIS.
Getting ready
Open the classification.qgs
project. It contains an RGB image and a vector layer with polygons.
How to do it…
The image has to be separated into individual bands. Run Split RGB bands using the provided image as the input, and you will obtain three layers named R, G, and B.
Open the Supervised classification algorithm from the Processing Toolbox menu...