4.2. Tutorial 2

The following is a tutorial about the functions of the Semi-Automatic Classification Plugin (SCP). It is assumed that you have a basic knowledge of QGIS.

4.2.1. Tutorial 2: Cloud Masking, Image Mosaic, and Land Cover Change Location

This tutorial is about the use of SCP for the assessment of land cover change of a multispectral image. It is recommended to complete the Tutorial 1: Your First Land Cover Classification before this tutorial.

The purpose of this tutorial is to locate land cover change over one year (between 2017 and 2018), using free Sentinel-2 images.

_images/workflow_lcc.jpg

Workflow

Following the video of this tutorial.

http://www.youtube.com/watch?v=xm9s97GPs0Y

4.2.1.1. Download the Data

We are going to download a Супутник Sentinel-2 image (Copernicus land monitoring services) and use the bands illustrated in the following table.

Sentinel-2 Bands Central Wavelength [micrometers] Resolution [meters]
Band 2 - Blue 0.490 10
Band 3 - Green 0.560 10
Band 4 - Red 0.665 10
Band 5 - Vegetation Red Edge 0.705 20
Band 6 - Vegetation Red Edge 0.740 20
Band 7 - Vegetation Red Edge 0.783 20
Band 8 - NIR 0.842 10
Band 8A - Vegetation Red Edge 0.865 20
Band 11 - SWIR 1.610 20
Band 12 - SWIR 2.190 20

Start QGIS and the SCP . Open the tab Download products clicking the button download in the Домашня, or in the Меню SCP. In the tab Download products click the button osm_add to display the OpenStreetMap tiles (© OpenStreetMap contributors) in the QGIS map, licensed as CC BY-SA (Tile Usage Policy ).

In general it is possible to define the area coordinates clicking the button pointer , then left click in the map for the UL point and right click in the map for the LR point. In this tutorial the study area is Rome (Italy), therefore click in the map to define the search area, or alternatively, enter these point coordinates in Search parameters:

  • UL: 12.4 / 41.9
  • LR: 12.5 / 41.8

The purpose of this tutorial is to map the land cover change between 2017 and 2018, therefore we need to download at least two images. Because of cloud cover, we are going to download an additional image for 2016, which will be used to replace pixels covered by clouds in the first image. We are searching for three images (tile 33TTG) acquired on:

  • 01 January 2017
  • 10 February 2017
  • 10 February 2018

Therefore, we need to perform three searches. Select Sentinel-2 from the Products input_list and set:

  • Date from: 2017-01-01
  • to: 2017-01-01

In this case, enter L1C_T33TTG in Filter to filter the results only for the tile 33TTG.

_images/tutorial_2_1_02.jpg

Search products

Now click the button Find search_images and after a few seconds the image will be listed in the Product list. Click the item in the table to display a preview that is useful for assessing the quality of the image and the cloud cover.

_images/tutorial_2_1_03.jpg

Search result

Repeat the date definition and the search also for the 2017-02-10 image. You can notice that there are a few clouds over the area, therefore we are going to mosaic this image with the one acquired on 2017-01-01.

_images/tutorial_2_1_04.jpg

Search result of second image

Finally, repeat the search for the 2018-02-10 image.

_images/tutorial_2_1_05.jpg

Search results

We can also select the bands to be downloaded according to our purpose. In particular, select the tab Download options and check only the Sentinel-2 bands that will be used in this tutorial and the ancillary data.

_images/tutorial_2_1_06.jpg

Download options

For the purpose of this tutorial, uncheck the option checkbox Only if preview in Layers because we want to download and preprocess all the images listed in the table.

Before starting the download we need to set the preprocessing options in the tab Sentinel-2 for preforming the Корекція DOS1. Check the options checkbox Apply DOS1 atmospheric correction and checkbox Add bands in a new Band set to automatically create a Band set for each image.

_images/tutorial_2_1_07.jpg

Preprocessing options

To start the image download, in the tab Download products click the button RUN run and select a directory where bands are saved (a new directory will be created for each image). The download could last a few minutes according to your internet connection speed. The download progress is displayed in a bar.

After the download, all the bands of all the Sentinel-2 images (© Copernicus Sentinel data 2018) are automatically loaded in the map. We can also display the RGB color composite of the Band sets clicking the list RGB= in the Робоча панель, and selecting the item 3-2-1.

_images/tutorial_2_1_08.jpg

Download of Sentinel-2 bands

4.2.1.2. Create the cloud cover mask

Before the land cover change assessment, we need to remove cloud cover pixels in the image acquired on 2017-02-10. Of course we could perform the same process for all the other images.

In QGIS, load the file MSK_CLOUDS_B00.gml that should be inside the directory L1C_T33TTG_A008556_20170210T100132_2017-02-10 . This vector file represents most of the cloud cover in the image. In QGIS Layers Panel, left click the vector MSK_CLOUDS_B00 MaskFeature and select Export > Save Feature as to save this gml file to shapefile (e.g. clouds.shp).

We can convert this vector file to raster using the tab Vector to raster.

Click the button reload to refresh the layer list, and select the vector clouds. Check the checkbox Use constant value to set the raster value 1 for clouds. Also, in Select the reference raster select the name of a band. This will create a raster with the same size and aligned to the Sentinel-2 image. Finally click the button RUN run to create the mask.

_images/tutorial_2_2_1.jpg

Vector to raster mask

We could also improve the mask by manually editing the pixel of the raster using the tool Edit raster or creating a semi-automatic classification of clouds.

4.2.1.3. Mask clouds in the Sentinel-2 image

We are going to mask all the pixels covered by clouds in all the bands composing the Band set of the image acquired on 2017-02-10.

In the tab Cloud masking, set the number of the 2017-02-10 Band set in Select input band set. In Select the classification we select the mask created at the previous step. Enter 1 in Mask class values. Finally, uncheck checkbox Use buffer of pixel size to speed up the masking process.

Now click the button RUN run to select the output directory and start the masking process.

_images/tutorial_2_3_1.jpg

Mask clouds

4.2.1.4. Mosaic the Sentinel-2 images

We are going to mosaic the 2017 images in order to create a cloud free image to be used for land cover change.

We use the image acquired on 2017-01-01 to fill the gaps in the 2017-02-10 image. In the tab Band set, add a new Band set with the button add_bandset and add the masked bands.

_images/tutorial_2_4_1.jpg

New Band set

Now we can mosaic the 2017 images.

In the tab Mosaic of band sets, in the Band set list enter the number of the 2017-02-10 masked Band set, followed by comma, followed by the number of the 2017-01-01 Band set. Now click the button RUN run to select the output directory and start the masking process.

_images/tutorial_2_4_2.jpg

Mosaic Band sets

We could have used more than 2 Band sets. The process automatically mosaic the corresponding bands of the input Band sets filling the NoData gaps of the first Band set with the pixels of the following Band sets. The mosaic bands are automatically added to the map.

_images/tutorial_2_4_3.jpg

Mosaic of 2017 images

4.2.1.5. Land cover change

We are going to automatically locate the land cover change between the image mosaic of 2017 and the 2018 image.

SCP includes a tool that allows for calculating the spectral distance between every corresponding pixel of two Band sets, and creating a raster of changes through a spectral distance threshold.

In the tab Band set, add a new Band set with the button add_bandset and add the mosaic bands.

_images/tutorial_2_5_1.jpg

New Band set

In the tab Spectral distance, set the number of the 2017 mosaic Band set in Select first input band set, and set the number of the 2018 Band set in Select second input band set. In Distance algorithm check the radiobutton Spectral Angle Mapping. Check the checkbox Distance threshold and set the value 10 that is the threshold used for creating the raster of changes.

Now click the button RUN run to select the output directory and start the masking process.

_images/tutorial_2_5_2.jpg

Spectral distance

After a while, the spectral distance raster and the raster of changes are added to the map

_images/tutorial_2_5_3.jpg

Raster of changes

This is an automatic method for locating land cover changes. We can see that most land cover changes are due to crop variations.

For instance, this method could be useful to assess vegetation burnt area or forest logging. We could set a different threshold value for increasing or reducing the number of pixels identified as changes.

Of course, in order to identify the type of land cover change we should identify the land cover classes of the images through photo-interpretation or with semi-automatic classification.