0% found this document useful (0 votes)
22 views

GIS

REMOTE SENSING LEARNINGS

Uploaded by

Vikas Bawa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

GIS

REMOTE SENSING LEARNINGS

Uploaded by

Vikas Bawa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 77

INTRODUCTION

QGIS, formerly known as Quantum GIS (until 2013), is a powerful, free, and open-source

desktop Geographic Information System (GIS) application that works across multiple

platforms. It is designed to facilitate the viewing, editing, and analysis of geospatial data.

As a versatile GIS tool, QGIS allows users to manage spatial information, create detailed

maps, and export them. The software supports both raster and vector data types, with

vector data represented through points, lines, or polygons. QGIS also enables the

georeferencing of various image formats.

Furthermore, QGIS accommodates numerous data formats, including shapefiles,

coverages, personal geodatabases, DXF files, MapInfo formats, and PostGIS databases.

It also integrates well with web services like Web Map Service (WMS) and Web Feature

Service (WFS), providing users with access to external data.

4
QGIS supports shape files, coverages, personal geodatabases, dxf, MapInfo,

PostGIS, and other formats. Web services, including Web Map Service and Web

Feature Service, are also supported to allow use of data from external sources.

Function:

 Layers

QGIS can display multiple layers containing different sources or depictions of sources.

 Preparing maps

In order to prepare printed map with QGIS, Print Layout is used. It can be used for

adding multiple map views, labels, legends, e

5
EXPERIMENT 1

OBJECTIVE: To know the basics of QGIS

 Overview of QGIS Interface

 Coordinate Reference Systems

 Digitizing Map Data

 Creating dataset Using Google Earth Pro

TASKS:

1. Explore the QGIS interface.

2. Learn about coordinate reference systems (CRS).

3. Digitize map data.

6
4. Create a dataset using Google Earth Pro.

1. What is QGIS?

Geographic information systems (GIS) are used in a wide range of academic and

applied fields. Simply put, GIS allows you to combine tabular data (e.g.

spreadsheet sheet) with geographic boundaries (e.g. maps). QGIS (or Quantum

GIS) is an open source geographic information system, meaning that it can be

downloaded and installed on your desktop free of charge. It runs on Windows,

Mac OS X, and Linux. If you have used ArcGIS before, QGIS is very similar, except

it has less functionality but is free.

7
COMPONENTS OF THE INTERFACE

Fig 1.1 QGIS software window and its components marked.

The components of the interface are as follows:

1. Main Menu: Provides access and functions of the applications in a

standard pull down menu format.

8
2. Toolbars: Buttons that provide one click access to many of the features

and functions found in the Main Menu. Toolbars are movable and can be

docked or free floating. You can also customize what toolbars to show

by right clicking (on a Windows machine) or Ctrl + clicking (on a Mac

laptop) on one of the toolbars and selecting/deselecting from the menu.

3. Browser Panel: Shows a listing of files on your computer. You can drag

and drop GIS files into the Layers Panel (4) to view them.

4. Layers Panel: Shows a listing of map layers and data files that are in

your current project. Layers can be turned off and on, change drawing

order, etc. Think of this as a Table of TASKSs.

5. Map Display Panel: Shows a geographic display of GIS layers in the Layers panel.

6. Status Bar: Shows the current scale of the map display, coordinates of

the current mouse cursor position, and the coordinate reference system

(CRS) of the project. For now, we won’t worry too much about this bar.

9
A. Coordinate Reference Systems

A CRS ensures that the map data aligns correctly with real-world geographic

locations. CRS can be classified into two major types:

Coordinate Systems, include two common types:

Fig 1.2 Types of Coordinate system

1. Geographic Coordinate Systems: Location on an ellipsoid is defined by

10
latitude and longitude that specifies the angle between any point

and the equator, and the angle between any point and the prime

meridian. A GCS defines where the data is located on the earth’s surface.

2. Projected Coordinate Systems: Location is defined on a flat

surface using Cartesian coordinates (i.e., x and y) that specify horizontal

and vertical position. A PCS tells the data how to draw on flat Surface, like

on paper map or a computer screen.

11
Bringing in a shapefile and layers. PROCEDURE:

1. Open QGIS software.

2. Open New project in Map display panel

3. Go to browser panel.

4. Search for shape file that is saved in particular folder with extension (.shp)

and double click on it to make it display on map display panel.

Fig 1.3 Selecting shapefile (.shp) in

browser panel

12
Fig 1.4 Shapefile in map display panel.

13
5. Go to toolbar and select option Select feature .

6. Now select the particular area on the map. The colour of selected feature will

change.

Fig 1.5 Selected feature colour change in map display panel.

7. Now go to LAYER panel and select the file and right click on the mouse.

8. Click on EXPORT and then click on SAVE SELECTED FEATURE AS. A

select vector layer dialogue box will appear.

9. Choose ESRI SHAPEFILE in FORMAT. Save the file at particular place in pc by

14
clicking at browser option.

10. Now choose coordinate system in CRS by clicking on world button: Type

particular country name in FILTER and choose country in PCS Projected

coordinate system.

15
Fig 1.6 Selecting coordinate system for a selected feature in Coordinate

Reference System Selector dialogue box.

11. Click on OK. Layer will be exported in LAYER PANEL.

12. Check the Properties of layer, by right click >PROPERTIES. Click on

INFORMATION and check units in metres and coordinate system in CRS.

16
Fig 1.7 Information of the feature in layer properties dialogue box.

17
WORK: Re-project the entire world map layer into World_Mercator projection system

RESULT:

Fig 1.8 World_Mercator Projection Result.

Conclusion:

1. We can work upon selected feature from a whole map by deselecting

the previous layer in LAYER PANEL.

2. You can work on different selected coordinate system for a selected

18
feature, whichever you want.

19
B. DIGITISING MAP DATA

PROCEDURE:

1. Open new Project and import new PNG file from Browser Panel by double

clicking it.

2. Go to TOOLBAR and choose Shape file layer OR Go to Main menu bar

and click on layer> Create Layer> New Shapefile Layer. A dialogue box

will appear.

3. Type the file name and Choose GEOMETRY TYPE: POINT, POLYGON or LINE

( Any 1) you want.

4. Keep Coordinate system in WGS.

5. Fill the Name in NEW FIELD (Ex. POINT). Then Click on ADD TO FIELD LIST

and Click OK.

20
Fig 1.9 New shapefile layer dialogue box.

6. Now click on the layer created in LAYER PANEL and go to TOOLBAR

and click on TOGGLE EDITING .

7. Now click on ADD POINT FEATURE beside TOGGLE EDITING OPTION.

8. Mark the Point on the map and Fill ID NO. and POINT name (eg. IT BUILDING).

9. To save the POINT click on TOGGLE EDITING again and dialogue box

will appear and click on OK.

NOTE: 1.Similar steps can be done for POLYGON AND LINE.

2. We can change the Properties of POINT, POLYGON or LINE by selecting

the layer> STYLE> EDIT SYMBOL.

21
3. LINE/POLYGON: Keep choosing the points continuously and right

click when the polygon points end.

22
OUTPUT:

Fig 1.10 Polygon Fig 1.11 Point

23
Fig 1.12 Line

24
CONCLUSION: Coordinates from a map, image or other sources of data are

converted into a digital format. The Converted data can be stored as POINT, LINE

or a POLYGON feature in GIS. By digitising the map we can analyse a particular

map and classify the marked features into different categories.

 Vector data is used to represent real world features in a GIS.

 A vector feature can have a geometry type of point, line or a polygon.

 Each vector feature has attribute data that describes it.

 Point geometries are made up of a single vertex (X,Y and optionally Z).

 Polyline geometries are made up of two or more vertices forming a connected

line.

 Polygon geometries are made up of at least four vertices forming an

enclosed area. The first and last vertices are always in the same place.

 Choosing which geometry type to use depends on scale, convenience and

what you want to do with the data in the GIS.

25
 Most GIS applications do not allow you to mix more than one geometry

type in a single layer.

 Digitising is the process of creating digital vector data by drawing it in a GIS

application.

 Vector data can be used for spatial analysis in a GIS application, for

example to find the nearest hospital to a school.

26
C. Creating dataset Using Google Earth Pro

PROCEDURE:

1. Open GOOGLE EARTH PRO application.

2. Search the particular area in search box.

3. Go to Toolbar and click on PIN button option at top.

4. Fill the NAME in the dialogue box and place the PIN at desired place. Click OK

5. Go to TOOLBAR and select POLYGON button option.

6. Fill the NAME in the dialogue box and select the points of particular area u

want to select. Click OK

Fig 1.13 Selecting an area in GOOGLE EARTH PRO.

27
7. Go to PLACES PANEL and choose the PIN file and right click> Save place

as, to save it. Save the file in .kml extension. Similarly save Polygon file

(.kml)

8. Open QGIS software.

9. Open New Project.

10. Go to MAIN MENU bar and click on LAYERS> ADD VECTOR LAYER.

11. Data source manager dialogue box will appear and then browse the .kml

file that u have saved and double click on ADD. Layers will be shown in

layer panel.

12. Go to BROWSER PANEL and click on XYZ TILES> OPEN STREET MAP.

Similarly u can right click XYZ TILES>new connection and add URL to add

more layers.

28
OUTPUT:

Fig 1.14 Import of Google earth pro file (.kml) in QGIS software.

CONCLUSION: Using GOOGLE EARTH PRO we can get the exact location,

longitude &

29
latitude of the particular area and we can plot those layers to QGIS software to

analyse the particular AREA.

30
EXPERIMENT 2

Image Stacking and Map Preparation using Remote Sensing Data

OBJECTIVE: To stack images from various bands and prepare a map using remote

sensing data.

PROCEDURE:

1. Open QGIS and create a new project.

2. Import the image file into the Browser Panel by double-clicking it.

31
Fig 2.1 Image file (.png) in Map display panel.

1. Go to LAYER PANEL and right click on the layer and click on the properties.

2. Click on SYMBOLOGY.

3. Set Render type: Multiband Color.

32
Fig 2.2 Layer property dialogue box- Symbology of the image file.

4. Now set;

 RED BAND to BAND 3 (BLUE)

 GREEN BAND to NOT SET

 BLUE BAND to NOT SET

Click OK. Take the output.

5. Now set;

 RED BAND to NOT SET

 GREEN BAND to BAND 2 (GREEN)

33
 BLUE BAND to NOT SET.

Click OK. Take the output.

6. Now set;

 RED BAND to NOT SET

 GREEN BAND to NOT SET

 BLUE BAND to BAND 1 (RED)

Click OK. Take the output.

7. Now set;

 RED BAND to BAND 3 (BLUE)

 GREEN BAND to BAND 2 (GREEN)

 BLUE BAND to BAND 1 (RED)

Click OK. Take the output.

34
OUTPUT:

Fig 2.3 EFFECT OF RED BAND WHEN SET TO BAND 3 (BLUE).

Fig 2.4 EFFECT OF GREEN BAND WHEN SET TO BAND 2

(GREEN).

35
36
Fig 2.6 EFFECT OF RED, GREEN & BLUE BAND WHEN: RED BAND SET TO BAND

3 (BLUE), GREEN BAND SET TO BAND 2 (GREEN) & BLUE BAND SET TO BAND 1

(RED)

CONCLUSION:

37
By manipulating the bands, you can analyze specific characteristics of the map. Each

band highlights different features, allowing for a better understanding of the area being

studied.

38
SOFTWARE EXPERIMENTS ON

USE OF SEMI-AUTOMATIC CLASSIFFICATION PLUGIN IN

QGIS

STUDY AREA: MADURAI, TAMIL NADU, INDIA.

39
EXPERIMENT-3

Experiment 3: Supervised Classification using the Semi-Automatic Classification Plugin

(SCP)

Objective:

Utilize the Semi-Automatic Classification Plugin (SCP) for supervised classification of

multispectral images.

Overview:

The SCP plugin, available in QGIS, enables users to conduct semi-automatic

(supervised) classification of remote sensing images. This method identifies specific

materials or land cover types in the image based on spectral signatures. The goal is to

generate a thematic map that represents various land cover classes.

Study Area:

Madurai, Tamil Nadu, India

PROCEDURE:

DOWNLOAD THE DATA:

1. Start QGIS and the SCP. Open the tab Download products clicking the

button in SCP menu.

40
2. In the tab Download products click the button to display the OpenStreetMap tiles.

3. Search for specific image acquired on 7 July 2020 because it is cloud free.

4. Choose the area coordinates clicking the button , then left click in the map

for the UL point and right click in the map for the LR point.

5. Select Sentinel-2 from the Products and set:

• Date from: 2020-07-07

• to: 2020-07-07

41
FIG 3. 1: OPEN STREET MAP VIEW OF Madurai (Tamil Nadu, India).

FIG 3.2: IMAGES LIST OF SENTINEL-2.

42
6. Now click the button Find and after a few seconds the image will be

listed in the Product list. Click the Product-ID

L2A_T43PHL_A026328_20200707T051953 in the table to display a preview

that is useful for assessing the quality of the image and the cloud cover.

7. Now click the button to load the preview in the map. We can also select

which bands to be downloaded according to our purpose. In particular, select

the tab Download options and check only the Sentinel-2 bands (2, 3, 4, 5, 6, 7,

8, 8A, 11, 12 and the ancillary data. Uncheck the option Preprocess images.

43
8. To start the image download, click the button RUN and select a

directory where bands are saved. After the download, all the bands are

automatically loaded in the map.

FIG 3.3: DOWNLOAD OPTION TAB AND VARIOUS BANDS OF SENTINEL-

2.

44
FIG 3.4: VARIOUS BANDS UPLOADED IN LAYER PANEL.

45
CLIP THE DATA:

9. Open the tab Band set clicking the button in the SCP menu or the SCP dock.

Click the button to refresh the layer list, and select the bands: 2, 3, 4, 5, 6,

7, 8, 8A, 11, and 12; then click to add selected rasters to the Band set 1.

FIG 3.5: BAND SET FOR CLIPPING

10. In Preprocessing open the tab Clip multiple raster’s. We are going to clip the

Band set 1 which contains Sentinel-2 bands.

11. Click the button and select an area such as the following image (left click

in the map for the UL point and right click in the map for the LR point).

12. Click the button RUN and select a directory where clipped bands are saved.

New files will be created with the file name prefix defined in Output name

46
prefix. When the process is completed, clipped rasters are loaded and

displayed.

FIG 3.6: CLIP AREA

47
PREPROCESS THE DATA:

13. In order to convert bands to reflectance, open the Preprocessing clicking the

button in the SCP menu and select the tab Sentinel-2.

14. Click the button Directory containing Sentinel-2 bands and select the

directory of clipped Sentinel-2 bands. The list of bands is automatically loaded

in the table Metadata. Ignore Select metadata file because this conversion

doesn’t require additional information. Sentinel-2 Level 2A images don’t

require the DOS1 Correction; if it was a Level 1C image we should enable the

option Apply DOS1 atmospheric correction.

TIP: In general, it is recommended to perform the DOS1 atmospheric correction

for the entire image (before clipping the image) in order to improve the calculation

of parameters based on the image.

For the purpose of this experiment, uncheck the option Create Band set and

use Band set tools because we are going to define this in the following step Define

the Band set and create the Training Input File.

15. Click the button RUN and select the directory where converted bands are

saved. After a few minutes, converted bands are loaded and displayed (file

name beginning with RT_). If Play sound when finished is checked in

48
Classification process settings, a sound is played when the process is finished.

We can remove all the bands loaded in QGIS layers except the ones whose name begin

with RT_.

FIG 3.7: CONVERTED SENTINEL-2 CLIPPED BANDS IN LAYER PANEL.

49
Define the Band set and create the Training Input File

16. Open the tab Band set clicking the button in the SCP menu.

17. In Band set definition click the button to clear all the bands from active

band set created during the previous steps.

18. Click the refresh button to refresh the layer list, and select all the converted

bands; then click to add selected rasters to the Band set. In the table Band set

definition order the band names in ascending order (click to sort bands by

name automatically).

19. Finally, select Sentinel-2 from the list Wavelength quick settings, in order to

set automatically the Center wavelength of each band and the Wavelength unit

(required for spectral signature calculation).

20. We can display a Color Composite of bands: Near-Infrared, Red, and Green: in

the Working toolbar, click the list RGB= and select the item 7-3-2

(corresponding to the band numbers in Band set. You can see that image

colors in the map change according to the selected bands, and vegetation is

highlighted in red (if the item 3-2-1 was selected, natural colors would be

displayed).

TIP : If a Band set is defined, a temporary virtual raster (named Virtual Band Set

1) is created automatically, which allows for the display of Color Composite. In

50
order to speed up the visualization, you can show only the virtual raster and hide

all the layers in the QGIS Layers.

FIG 3.8: DEFINITION OF BAND SET.

51
FIG 3.9: Color composite RGB=7-3-2.

21. In the SCP dock select the tab Training input and click the button to create

the Training input (define a name such as training.scp). The path of the file is

displayed and a vector is added to QGIS layers with the same name as the

Training input (in order to prevent data loss, you should not edit this layer using

QGIS functions).

CREATE THE ROI’S

We are going to create ROIs defining the Classes and Macroclasses. Each ROI is

identified by a Class ID (i.e. C ID), and each ROI is assigned to a land cover class

through a Macroclass ID (i.e. MC ID). We are going to use the Macroclass IDs

defined as follows.

52
Macroclass name & Macroclass ID: Water-1, Built-up-2, Vegetation-

3 & Soil-4. ROIs is drawn manually drawing a polygon.

22. In the map zoom over the dark blue area in the lower left corner of the image

which is a water body. To manually create a ROI inside the dark area, click the

button in the Working toolbar. Left click on the map to define the ROI

vertices and right click to define the last vertex closing the polygon. An orange

semi-transparent polygon is displayed over the image, which is a temporary

polygon (i.e. it is not saved in the Training input).

TIP : You can draw temporary polygons (the previous one will be overridden) until

the shape covers the intended area. If the shape of the temporary polygon is good

we can save it to the Training input.

23. Open the Training input to define the Classes and Macroclasses. In the ROI &

Signature list set MC ID = 1 and MC Name = Water; also set C ID = 1 and C Name

= Lake.

53
24. Now click to save the ROI in the Training input. After a few seconds, the ROI

is listed in the ROI & Signature list and the spectral signature is calculated

(because Signature is checked). As you can see, the C ID in ROI & Signature list

is automatically increased by 1. Saved ROI is displayed as a dark polygon in the

map and the temporary ROI is removed. Also, in the ROI & Signature list you

can notice that the Type is RS, meaning that the ROI spectral signature was

calculated and saved in the Training input.

FIG 3.10: A TEMPORARY ROI FOR WATER CREATED MANUALLY.

25. Now we are going to create a second ROI for the built-up class using the

automatic region growing algorithm. Zoom in the upper region of the image. In

Working toolbar set the Dist value to 0.05 . Click the button in the Working

toolbar and click over the light blue area of the map. After a while the orange

54
semi-transparent polygon is displayed over the image.

TIP : Dist value should be set according to the range of pixel values; in general,

increasing this value creates larger ROIs.

FIG 3.11: A TEMPORARY ROI FOR BUILT-UP CREATED MANUALLY.

55
In the ROI & Signature list set MC ID = 2 and MC Name = Built-up ; also set C ID =

(it should be already set) and C Name = Buildings.

After clicking the button in the Working toolbar you should notice that the

cursor in the map displays a value changing over the image. This is the NDVI

value of the pixel beneath the cursor (NDVI is displayed because the function

Display is checked in ROI options). The NDVI value can be useful for

identifying spectrally pure pixels, in fact vegetation has higher NDVI values

than soil.

26. For instance, move the mouse over a vegetation area and left click to create

a ROI when you see a local maximum value. This way, the created ROI and the

spectral signature thereof will be particularly representative of healthy

vegetation.

Create a ROI for the class Vegetation (red pixels in color composite RGB=7-

3-2) and a ROI for the class Soil (bare soil or low vegetation) (yellow pixels

in color composite RGB=7-3-2) following the same steps described

previously. The following images show a few examples of these classes

identified in the map.

56
FIG 3.12: A TEMPORARY ROI FOR VEGETATION AND SOIL, CREATED MANUALLY.

ASSESS THE SPECTRAL SIGNATURE

One can simply assess spectral signature similarity by displaying a signature plot.

In order to display the signature plot, in the ROI & Signature list (page 24) highlight

two or more spectral signatures (with click in the table), then

27. Click the button in SCP Dock where ROI’s are listed. The Spectral Signature

Plot is displayed in a new window.

28. Move and zoom inside the Plot to see if signatures are similar (i.e. very close).

Double click the color in the Plot Signature list to change the line color in the

plot.

We can see in the following figure a signature plot of different materials.

57
FIG 3.13: SPECTRAL PLOT.

CREATE A CLASSIFICATION PREVIEW

Before running a classification (or a preview), set the color of land cover classes

that will be displayed in the classification raster.

29. In the ROI & Signature list, double click the color (in the column Color) of each

ROI to choose a representative color of each class. Also, we need to set the

color for macroclasses in ROI & Signature list.

58
30. Now we need to select the classification algorithm. In this experiment we are

going to use the Maximum Likelihood.

31. Open the tool Classification to set the use of classes or macroclasses. Check

Use C ID and in Algorithm select the Spectral Angle Mapping. The input

band set is 1 because it is the number of the band set containing the image

(bands) that we want to classify.

TIP : Change frequently the Color Composite in order to clearly identify the

materials at the ground; use the mouse wheel on the list RGB= of the Working

toolbar for changing the color composite rapidly; also use the buttons and

for better displaying the Input image (i.e. image stretching).

59
FIG 3.14: DEFINITION OF CLASS COLOURS.

60
FIG 3.15: SETTING THE ALGORITHM AND USING C ID.

61
32. In Classification preview set Size = 300; click the button and then left click

a point of the image in the map. The classification process should be rapid, and

the result is a classified square centered in clicked point. Previews are

temporary rasters (deleted after QGIS is closed) placed in a group named

Class_temp_group in the QGIS panel Layers.

33. Now in Classification check Use MC ID and click the button in

Classification preview. We can see that now there are only 4 colors

representing the macroclasses.

TIP : When loading a previously saved QGIS project, a message could ask to

handle missing layers, which are temporary layers that SCP creates during each

session and are deleted afterwards; you can click Cancel and ignore these layers;

also, you can delete these temporary layers clicking the button in Working

toolbar.

62
Fig 3.16: CLASSIFICATION PREVIEW DISPLAYED OVER THE IMAGE USING C ID

CREATE A CLASSIFICATION OUTOUT

34. In Classification check Use MC ID.

35. In the Classification output click the button and define the path of the

classification output, which is a raster file (.tif). If Play sound when finished

is checked in Classification process settings, a sound is played when the

process is finished.

63
RESULT:

Fig 3.17: CLASSIFICATION OUTPUT.

CONCLUSION:

With the aid of Semi-Automatic Classification Plugin, the classification of the area

is done to identify the following land cover classes:

1. Water;

2. Built-up;

64
3. Vegetation;

4. Soil.

In the Spectral plot we can see the line of each signature (with the color defined

in the ROI & Signature list), and the spectral range (minimum and maximum) of

each band (i.e. the semi- transparent area colored like the signature line). The

larger is the semi-transparent area of a signature, the higher is the standard

deviation, and therefore the heterogeneity of pixels that composed that signature.

Spectral similarity between spectral signatures is highlighted in orange in the

Plot Signature list. Additionally, we can calculate the spectral distances of

signatures (for more information see Spectral Distance). Highlight two or more

spectral signatures with click in the table Plot Signature list, then click the button;

distances will be calculated for each pair of signatures. Now open the tab Spectral

distances; we can notice that similarity between signatures vary according to

considered algorithm.

65
EXPERIMENT-4

OBJECTIVE: Use of Semi-Automatic Classification Plugin for the “Unsupervised”

classification of a multispectral image.

TASKS: Clustering is the grouping of pixels based on spectral similarity (e.g.

Euclidean Distance or Spectral Angle) calculated for a multispectral image

(Richards and Jia, 2006).

Clustering can be used for unsupervised classification or for the automatic

selection of spectral signatures. It is worth noticing that, while Supervised

Classification produces a classification whit the classes identified during the

training process, the classes produced by clustering (i.e. clusters) have no

definition and consequently the user must assign a land cover label to each class.

The main advantage of clustering resides in automation. Of course, clusters do

not necessarily represent a particular land cover type and additional processing

66
could be required for producing an accurate classification.

The study area of this experiment is Madurai (Tamil Nadu, India) which is a city in

the Southern India.

PROCEDURE:

INPUT THE DATA

1. Start QGIS and the SCP.

2. The downloaded product is a Sentinel-2 Level 2A image, which is already

atmospherically corrected (Level 1C images require atmospheric correction

as described in Image conversion to reflectance).

Conversion to reflectance (see Radiance and Reflectance) can be performed

automatically. In order to convert bands to reflectance, open the

Preprocessing, clicking the button in the SCP menu and select the tab

Sentinel-2.

3. Click the button Directory containing Sentinel-2 bands and select the

directory of Sentinel- 2 bands. The list of bands is automatically loaded in the

table Metadata. You can ignore Select metadata file because this conversion

doesn’t require additional information.

4. Check the option Create Band set and use Band set tools in order to create

67
automatically the input Band set that will be used for clustering.

5. To start the conversion process, click the button RUN and select the

directory where converted bands are saved. After a few minutes, converted

bands are loaded and displayed (file name beginning with RT_).

6. Open the tab Band set clicking the button in the SCP menu. The bands are

already listed in the first Band set.

68
Fig 4.1: CONVERTED BANDS.

Fig 4.2: BAND SET.

CLUSTERING

69
Clustering requires the user to define the number of clusters (i.e. classes)

expected in the image, which correspond to as many spectral signatures (i.e.

seeds). During the first iteration clusters are produced calculating the pixel

spectral distance with initial spectral signatures. Pixels are assigned according to

the most similar spectral signature, therefore producing clusters. In this tutorial

we are going to perform clustering using the ISODATA algorithm, which includes

steps for merging clusters having similar spectral signatures and splitting

clusters having too high variability. We are going to select randomly the starting

spectral signatures and use the algorithm Euclidean Distance for distance

calculation.

70
7. Open the tab Clustering clicking the button in the SCP menu.

8. In Select input band set , we set 1 because we are going to classify the

first Band set. In Method check ISODATA. In Distance threshold set 0.01,

which is the distance required for merging clusters.

In Number of classes set 10; we set a number higher than the land cover

classes defined at the beginning of this tutorial because we try to account

for spectral variability of classes. In Max number of iterations set 10; in

general, the more the iterations the better the result. In ISODATA max

standard deviation we set the maximum standard deviation considered for

splitting a class; we can set the value 0.2 here. In ISODATA minimum class

size in pixels we can set 10.

9. We check the option Use random seed signatures to randomly selects the

spectral signatures of seed pixels from Band set.

10. Now click the button RUN and define the path of the classification output.

71
Fig 4.3: CLUSTERING TOOL.

11. After the process, the result is displayed in the map. The result of the

unsupervised classification is a raster having values that don’t correspond to

the class IDs defined at the beginning of this tutorial. The number of classes

can vary depending on the various iterations.

The mean spectral signature of output classes is displayed in the panel. We

could also save these spectral signatures in a previously created Training

input if we wanted to use these in other supervised classifications.

72
Fig 4.4: RESULT OF CLUSTERING.

RECLASSIFICATION OF THE OUTPUT

We must identify the correspondence between raster classes and the land cover

class IDs defined at the beginning of this experiment.

We can perform this task through photointerpretation. We can display a Color

Composite of bands: Near-Infrared, Red, and Green: in the Working toolbar, click

the list RGB= and select the item 7- 3-2 (corresponding to the band numbers in

Band set). You can see that image colors in the map change according to the

selected bands, and vegetation is highlighted in red (if the item 3-2-1 was selected,

natural colors would be displayed).

73
Fig 4.5: COLOR COMPOSITE RGB=7-3-2.

74
Now we can reclassify the output raster according to out classification system.

12. Open the tool Reclassification (page 90) clicking the button in the SCP

menu (page 19) or the SCP dock.

13. Click Calculate unique values to automatically calculate unique values in

the classification and fill the reclassification table. In New value set the

corresponding New class ID.

14. When the table is complete, click the button RUN and define the path of

the classification output.

15. After the process, the raster is added to the map. We can define a symbology

according to our classes. By clicking the band in layer panel and then click

properties > Symbology.

16. For reducing those errors we could repeat the clustering step increasing the

Number of classes, reducing the value ISODATA max standard deviation, and

increasing the value Distance threshold.

REFINEMENT OF THE OUTPUT

The classification could contain small patches of pixels that we would like to

remove from the classification result. We can use the tool Classification sieve

(page 85) to remove small patches of isolated pixel replacing them with the value

75
of the largest neighbor patch.

17. Open the tool Classification sieve clicking the button in the SCP menu.

18. In Select the classification select the raster reclassified in the previous

step (click Refresh button to refresh the layer list if the classification is not

listed). In Size threshold enter 2 to set the maximum size of the patch to be

replaced (in pixel unit); all patches smaller than the selected number of pixels

will be replaced by the value of the largest neighbor patch. Setting the value 2

we are going to remove isolated single pixels.

Fig 4.6: RECLASSIFICATION.

76
Fig 4.7: RECLASSIFICATION RASTER.

77
Fig 4.8: SIEVE TOOL.

19. In Pixel connection : select 8 as the type of pixel connection in a 3x3

window (i.e. diagonal pixels are considered connected).

20. Now click the button RUN and define the path of the classification output.

After the process, the raster is added to the map. We should see that single

pixels have been replaced by the largest neighbour patch, resulting in a

cleaner classification.

78
RESULT:

Fig 4.9: UNSUPERVISED CLASSIFICATION OUTPUT.

CONCLUSION:

Clustering can be used for unsupervised classification, which means that no

training input is required, producing classes (i.e. clusters) that have no definition

and consequently the user must assign a land cover label to each class.

With the aid of Semi-Automatic Classification Plugin, the classification of the area

79
is done to identify the following land cover classes:

1. Water;

2. Built-up;

3. Vegetation;

4. Soil.

80

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy