Supervised classification in QGIS

From CUOSGwiki
Jump to navigationJump to search

Purpose

Every day thousands of satellite images are taken. To work with these images they need to be processed, e.g. they need to be classified. Since Remote Sensing software can be very expensive this tutorial should provide an open-source alternative: the Semi-automatic-classification plugin (SCP) in QGIS. You can already find a tutorial about the SCP here [1]. With this tutorial you can extend your ability to use the SCP while running through a supervised land-cover classification.

Introduction

Land-cover classification classifies every pixel to a defined class using the spectral signatures. To define the classes region of interests (ROI) must be set.

Installing the Software and SCP

To start the tutorial you have to download the latest version of QGIS which is QGIS 3.4.1. "Bonn" and can be found here[2]. Make sure to download the proper version for your PC (34bit vs. 64bit). After installing the software the the Semi-automatic classification Plugin must be installed into QGIS. Navigate to the menu at the top to Plugin and select Manage and Install Plugins. Following the picture, the SCP can be found while typing "semi" in the search bar. Click install plugin and now you should be able to see the SCP Dock at the right or left of your user surface.

SCP.jpg

Obtaining the Data

In this Tutorial, Sentinel-2 Data from the south of Lake Garda, Italy is used to run the classification. The data can be downloaded from the USGS Earth Explorer website here[3]. You can found a explanation how to download data from the Earth Explorer in the Tutorial Remote Sensing Analysis in QGIS. To find the same picture as used in this tutorial search for Lake Garda and select the time period from August to October 2018. Among Data Sets select Sentinel-2 and you should find the following picture:

Sentinel-2image.JPG


It has the ID L1C_T32TPR_A008056_20180921T101647 and is shot the 21st of September 2018.

Unpack the Data

The downloaded data is packed in a zip-File. Therefore, you have to unzip the Data before working with it. Afterwards you can find the image data under GRANULE → L1C_T32TPR_A008056_20180921T101647 → IMG_DATA. Here you can find for each band of the Sentinel satellite a separate JPEG file.

Preprocessing Data

Load the Data into QGIS

To load the Data into QGIS navigate to Layer at the top your user surface. Choose Add Layer, and then Add Raster Layer.... You should see the Data Source Manager now. Leave "File" selected like it is in default. Under Datasets you can navigate to the directory described above. Make sure to load all JPEG files into QGIS except the file of band 10: T32TPR_20180921T101019_B10.

Clip the Data

For a basic classification the area covered by the picture is very big. Therefore, we can clip the data and only work with a part of the picture.

Data

To download opensource satellite imagery, usually the USGS Earth Explorer website can be used and is found here [4].