Supervised Land Use Classification in QGIS: A Practical Workflow for Mapping Urban Land-Cover Categories

Supervised Land Use Classification in QGIS

A satellite image measures brightness across multiple bands of wavelengths for each individual picture element (pixel), but what a planner requires is a map that indicates whether each pixel is water, a tree, a building or bare ground. That is done typically by supervised classification. The analyst presents a number of examples of each class to the software, the software learns the appearance of those examples in the bands and then labels each remaining pixel according to its appearance in the bands. If performed correctly and under supervision, classification in QGIS can generate a land cover map which can be measured, compared to the previous year, and can be incorporated into planning. If not done carefully, it yields a confident looking map that is incorrect in a manner no one will be able to detect. This guide walks you through the workflow step-by-step, provides a worked example with actual accuracy numbers for a synthetic scene and discusses where errors can occur.

What Supervised Classification Means

In supervised classification, the analyst provides training samples; specific small regions where the class is known. The algorithm involves summarizing the spectral values within each class, then assigning to each pixel of the image the class which it best matches. Unsupervised classification is the opposite, first grouping the pixels into clusters and then asking the analyst the name of them. Supervised methods include more control for the analyst, which is the typical approach used when classifying land use land cover in cities, where the classes must be consistent with a planning scheme.

There are two terms that can be confused. Land cover refers to the type of material on the surface of the earth, e.g. water, trees, impervious surfaces or bare soil. Land use refers to the uses of the land, for example, housing, recreation or agriculture. Satellites can view cover directly and must be determined by use. A grassy area may be a park, pasture or an airport verge. Choose at the beginning the one that the map should display, as the class definitions and the training samples are based on this.

Stage 1: Define the Classes and the Question

Begin with the purpose. A map for monitoring green space needs different classes from a map for flood risk. Keep the scheme short and make the classes separable in the data. The Anderson classification system, developed for the United States Geological Survey in 1976, remains a widely used model for land use and land cover schemes, and many national schemes follow its logic. For a first urban map, five classes are a sensible start, as in the table. The last column warns which classes are likely to be confused.

ClassWhat It CoversLikely Spectral Confusion
WaterRivers, lakes, ponds, reservoirsShadows, very dark roofs
Dense vegetationTree cover, closed canopy, woodlandTall crops, well-watered lawns
Grass or croplandLawns, pasture, fields, sparse greeneryDense vegetation, fallow fields
Built-upBuildings, roads, paved surfacesBare soil, dry sandy areas
Bare soilVacant plots, construction sites, exposed groundBuilt-up, dry cropland

Stage 2: Prepare the Imagery

The usual starting point for QGIS remote sensing is free imagery. Sentinel-2 offers 10 m pixels in the blue, green, red and near-infrared bands and 20 m in the shortwave infrared, with frequent revisits. Landsat 8 and 9 offer 30 m pixels and a long archive. Check the current specifications with the provider before planning a project. Preparation typically includes these steps:

  1. Choose a clear image. prefer low cloud cover and a date in the season that best separates your classes.
  2. Use surface reflectance. corrected products make dates comparable and spectra more consistent.
  3. Match the pixel size. resample 20 m bands to 10 m, or work at 20 m, so all bands align.
  4. Clip to the study area. this speeds up processing and keeps the file manageable.
  5. Stack the bands. build a band set or virtual raster so the classifier sees all bands together.

The Semi-Automatic Classification Plugin, a widely used QGIS plugin by Luca Congedo, handles much of this, including band sets and downloads of Sentinel-2 and Landsat data. Its interface has changed between versions, so follow the documentation for the version you install.

Stage 3: Collect Training Samples

Training samples are the heart of the method, and the classifier is only as good as they are. In QGIS you draw polygons, often called regions of interest, over areas you are sure about. Verify them with high-resolution imagery, field visits or local knowledge, and follow these principles:

  1. Stay inside uniform patches. avoid edges, where mixed pixels blur the spectra.
  2. Spread polygons across the scene. variation in light, soil and roof materials should be covered.
  3. Cover each class’s variety. a built-up class needs concrete, metal and tiled roofs, not one roof type.
  4. Balance the classes. similar numbers of samples per class prevent bias toward large classes.

Check separability before classifying. The plugin can show spectral signatures and compute distances between classes, such as the Jeffries-Matusita distance, where values near the maximum of 2 indicate classes that are easy to separate. Classes with low separability, such as built-up and bare soil, will be confused later. It is better to learn this now and merge classes, collect more samples or add inputs than to find out after mapping.

Stage 4: Choose and Run the Algorithm

Which algorithm to use depends on the data and the tool. The Semi-Automatic Classification Plugin offers classical methods such as minimum distance, maximum likelihood and spectral angle mapping, and other routes in QGIS include the Orfeo Toolbox and GRASS or SAGA tools from the Processing toolbox. Machine-learning methods such as random forest and support vector machines are also available through additional tools. Check what your installed version provides.

AlgorithmHow It DecidesStrengthLimitation
Minimum distanceAssigns a pixel to the nearest class meanSimple and fastIgnores spread within classes
Maximum likelihoodUses class mean and variance to compute probabilityWorks well with good, normally distributed samplesSensitive to poor training data
Spectral angle mappingCompares the shape of the spectrum, not brightnessLess affected by illuminationCan miss classes that differ mainly in brightness
Random forest or SVMLearns decision rules from samplesHandles overlap and extra inputs wellNeeds more setup; harder to explain

There is no single best algorithm. Good training data usually matters more than the choice of method, and a simple algorithm with good samples often beats a sophisticated one with weak samples.

Stage 5: Assess Accuracy Honestly

A classification without an accuracy assessment is only a picture. The standard approach is to create independent reference points, label each one from reliable evidence such as high-resolution imagery or field checks, and compare them with the classified map in a confusion matrix. Congalton’s widely cited guidance suggests at least about 50 reference samples per class, with more for large or complex areas. Reference points must be independent of the training samples. If the same pixels are used for both, the accuracy will look better than it is.

Four measures come from the matrix. Overall accuracy is the share of reference points correctly mapped. The kappa coefficient adjusts for agreement that could occur by chance. Producer’s accuracy, for each class, is the share of reference points of that class that were mapped correctly, and shows how much of the true class was found. User’s accuracy is the share of map pixels labelled as a class that really belong to it, and shows how far the map can be trusted for that class.

A Worked Example With a Synthetic Scene

To show satellite image classification in numbers, a synthetic five-band scene of 120 by 120 pixels was generated with five classes. Two of them, built-up and bare soil, were deliberately made spectrally similar, as often happens in real cities. Eight training polygons of 4 by 4 pixels were placed per class, giving 640 training pixels. A random forest classifier with 200 trees was trained, then tested on 300 independent reference points, 60 per class, that were not used in training. Figure 1 shows the scene and the result.

Supervised Land Use Classification in QGIS

Figure 1: False-colour composite and classified map (synthetic scene, illustrative only).

The overall accuracy was 84.3% and the kappa coefficient was 0.80. That sounds good, yet the class results tell a more useful story, shown in the confusion matrix and in Figure 2.

Reference \ MapWaterDense veg.GrassBuilt-upBare soilTotal
Water60000060
Dense vegetation048120060
Grass or cropland01590060
Built-up001461360
Bare soil000204060

Water and grass were mapped almost perfectly. Dense vegetation lost 12 of 60 points to grass, giving a producer’s accuracy of 80.0% while its user’s accuracy was 98.0%, so the pixels labelled as dense vegetation were nearly all correct but a fifth of the true dense vegetation was missed. The problem is concentrated in built-up and bare soil: 13 built-up points were labelled bare soil and 20 bare-soil points were labelled built-up. Built-up reached a producer’s accuracy of 76.7% and a user’s accuracy of 69.7%, and bare soil reached 66.7% and 75.5%.

Supervised Land Use Classification in QGIS

Figure 2: Producer’s and user’s accuracy by class (synthetic example).

The classification also shifts area totals, which matters when a map is used to measure change. The table compares the true share of each class with the share on the classified map.

ClassTrue Share of SceneShare on Classified Map
Water7.7%7.7%
Dense vegetation14.0%13.2%
Grass or cropland38.8%39.9%
Built-up29.0%25.4%
Bare soil10.4%13.9%

Built-up land is under-mapped by 3.6 percentage points and bare soil is over-mapped by 3.5. A planner who counted pixels directly would understate urban area and overstate vacant land, which is exactly the kind of error that distorts decisions. Good practice, described by Olofsson and colleagues in 2014, is to use the error matrix to adjust area estimates and report their uncertainty.

One more result is worth noting. Training with 160, 320, 640 and 1,280 pixels gave overall accuracies of about 80%, 84%, 84% and 83% on the same test points. More samples helped at first and then stopped helping, because the limit was the spectral overlap between built-up and bare soil, not the number of samples. Fixing that needs better inputs, such as an index, texture, another date or finer imagery, rather than just more polygons. These numbers describe an invented scene and should not be read as typical accuracies.

Stage 6: Clean Up and Use the Map

A pixel-based map usually has isolated pixels of the wrong class, often called salt-and-pepper noise. A sieve or majority filter removes tiny patches, though too much smoothing erases real small features. Reclassify and merge classes where needed, so the final land use land cover classification matches the scheme defined in Stage 1, then vectorise the result if polygons are required. GIS land cover mapping becomes useful when the classified raster is combined with other layers: ward boundaries to compute class areas, population to estimate green space per person, or a second date to measure change. Always keep the accuracy report with the map, so that anyone using the GIS land cover mapping output knows how far to trust it.

Common Problems and How To Avoid Them
Common SlipWhat To Do Instead
Training areas drawn on mixed pixels or edgesDraw polygons well inside uniform patches
Too few samples for variable classesCollect several polygons across the whole scene
Testing with the same pixels used to trainKeep independent validation points
Mixing land use and land coverDecide which one the map shows and define classes to match
Using a cloudy or off-season imageChoose a clear image from the right season
Reporting only overall accuracyReport class accuracies and the confusion matrix
Improving a Weak Result

If the class is not well mapped, determine the causes sequentially. First look for edges, mislabels and missing variety in the training samples. Next check the separability of the problem classes. Then try adding information: spectral indices (e.g. NDVI), built up or bare soil index, texture measures, or another seasonal image. Lastly, think of an algorithm and/or a simple rule after classification. As with any other QGIS remote sensing workflow, improving the inputs usually results in more than tuning the algorithm.

Satellite Image Classification Support From Simbi Labs

Simbi Labs provides GIS surveying and mapping services for satellite image classification and land cover mapping for project planning and monitoring. Look over the services page or schedule a complimentary consultation to speak about your project.

Explore GIS Survey Services

Book a Free Consultation

Contact Simbi Labs

Frequently Asked Questions

What is supervised classification in QGIS?

It is a method in which you mark training areas of known land cover, and the software uses them to assign every pixel in the image to a class.

What is land use land cover classification?

It is the process of mapping the physical cover of the land, such as water, vegetation and built-up areas, and the human use of that land, using a defined set of classes.

Which tools are used for QGIS remote sensing?

The Semi-Automatic Classification Plugin is the most common, and the Processing toolbox adds options such as the Orfeo Toolbox, GRASS and SAGA.

How is the accuracy of a land cover map checked?

Independent reference points are compared with the map in a confusion matrix, from which overall accuracy, kappa, producer’s accuracy and user’s accuracy are calculated.

Why is GIS land cover mapping used in planning?

It measures how much of each cover type exists and how it changes, which supports decisions on green space, growth and environmental protection.

Leave a Comment

Your email address will not be published. Required fields are marked *