Classification in R

We want to utilize a Random Forest (RF) and a Support Vector Classifier (SVM) algorithm in order to classify the Berlin land cover in six elementary categories: bare soil, water, grassland, forest, urban low density, and urban high density. Therefore, we need an image dataset and a shapefile containing points or polygons to which the respective class is attributed.

The workflow will be exemplified by a L8 scene (ID: LC08_L1TP_193023_20170602_20170615_01_T1), which you may already have acquired during the L8 Download Exercise. You need to preprocess the scene as shown in chapter Preprocess. In addition, we narrowed our research area to Berlin to keep the data small (as shown in chapter Visualize in R).

You can download both the preprocessed image and the shapefile for testing purposes here.

Section in a Box

This section guides you through a complete classification process for satellite imagery. The resulting classification maps will be validated in the next chapter.

Sample in QGIS
– some basic considerations and tips for sampling
– collect training polygons in QGIS for supervised classification
Prepare Samples in R
– import training polygons into R
– use training polygons to extract raster information
– put everything together in a data frame
RF Classification
– train a RF model with “randomForest” package
– classify image data and export a classification image
SVM Classification
– train a SVM (C-Classification method) with “e1071” package
– classify image data and export a classification image