Landscape Change Assessment using Unsupervised Image Classification in GRASS GIS

From CUOSGwiki
Revision as of 21:59, 15 December 2019 by Lindot (talk | contribs)
Jump to navigationJump to search

Purpose

The purpose of this tutorial is:

Introduction to GRASS GIS

GRASS GIS Logo


Methods

Software Download and Installation

In this tutorial, GRASS GIS version 7.8.1 for Windows is being used, however this software is also available for Mac and Linux users. The latest version of GRASS GIS may be downloaded here. This website contains very useful information and documentation for users that have never been exposed to GRASS GIS before now. I highly suggest looking at this documentation, as well as this tutorial which provides more information on GRASS GIS.

Data Set

Because this tutorial is being written to demonstrate the ability of GRASS GIS to assess changes in landscapes, a data set has been provided for the user. There are many sources where one can find satellite imagery data, however a data set is being provided to the user so they may follow along with this tutorial without having their own data set. This data set consists of two GeoTiff files acquired using the Earth Observing System (EOS) Landviewer tool. These GeoTiff files contains an image obtained by Landsat 7 on September 7, 2000 and an image obtained by Landsat 8 on September 23, 2017. Both images contain imagery of the same area of interest (AOI) which consists of a 40.04 km² square area centered at 45.03001°N 75.68135°W. This area is located in Kemptville, Ontario, an area which has undergone development since the early 2000s to accommodate for increased population sizes. The population of Kemptville is expected to rise given it's close proximity to Ottawa, making it an ideal location for commuters to reside, which means that further development is also expected.

Landscape Change Assessment Data Set
Data Information Data File
GeoTIFF file for raster imagery from September 7, 2000 with bands 2, 3, and 4 (Landsat 7) September 2000 File
GeoTIFF file for raster imagery from September 23, 2017 with bands 2, 3, and 4 (Landsat 8) September 2017 File
GeoTIFF file for raster imagery from September 7, 2000 with bands 1, 2, and 3 (Landsat 7) [September 2000 Visible Bands File]
GeoTIFF file for raster imagery from September 23, 2017 with bands 1, 2, and 3 (Landsat 8) [September 2017 Visible Bands File]

Starting GRASS GIS

Once GRASS GIS is properly installed on your computer, you may locate it and open the program.

LT StartGrass 1.png

Figure 1: The GRASS GIS Startup Interface

1)

LT DefineGrassLocation 1.png

Figure 2: The "Define New GRASS Location" window where the user selects a Data Directory and Project Location.

1)

LT DefineGrassLocation 2.png

Figure 3: The "Define New GRASS Location" window where the user chooses a method for creating a new Location.

1)

LT DefineGrassLocation 3.png

Figure 4: The "Define New GRASS Location" window where the user selects a georeferenced file.

1)

LT DefineGrassLocation 4.png

Figure 5: The "Define New GRASS Location" window summary page.

1)

LT DefineGrassLocation 5.png

Figure 6: The "GRASS Startup" window with a Directory, Location, and Mapset selected.


1)

LT StartGrass 2.png

Figure 7: The "GRASS Command" window.

1)

LT StartGrass 3.png

Figure 8: The "GRASS Map Display" window.

1)

LT StartGrass 4.png

Figure 9: The "GRASS Layer Manager" window.

Adding Extensions

LT AddonsExtension 1.png

Figure 10: The path to install new add-ons in GRASS GIS.

LT AddonsExtension 2.png

Figure 11: The "Fetch & Install Extension from GRASS Add-ons" window with search results for the r.smooth.seg add-on.

LT AddonsExtension 3.png

Figure 12: The "Fetch & Install Extension from GRASS Add-ons" window with search results for the r.change.info add-on.


1) At this point, GRASS GIS must be closed and restarted. Upon opening GRASS GIS for the second time, navigate to the Modules tab at the bottom of the "Layer Manager" window.
2) Click the + sign beside the Addons category to expand it.
3) Double-click on the add-on to run the selected module, or select it and press "Run" in the bottom right corner.

LT AddonsExtension 4.png

Figure 13: The "Layer Manager" window with the Modules tab open, and the newly installed add-on selected.

Importing Landsat Rasters

r.in.gdal [(https://grass.osgeo.org/grass78/manuals/r.in.gdal.html]

1)

LT ImportRaster 1.png

Figure 14: The path to import raster data using the r.in.gdal module.

1)

LT ImportRaster 2.png

Figure 15: The "r.in.gdal Module" window showing input and output raster information on the "Required" tab.

1)

LT ImportRaster 3.png

Figure 16: The "r.in.gdal Module" window showing the "Command Output" tab.

1)

LT Refresh.png

Figure 17: The "Refresh" button on the "Data" tab in the "Layer Manager" window.


Visualizing Layers

1)

LT DoubleClickLayers 1.png

Figure 18: The "Map Display" window and "Layer Manager" window showing the "Sept2000.1" layer.


d.rgb [1]

1)

LT RGB 1.png

Figure 19: The path to add an RGB map layer using the d.rgb module.

1)

LT RGB 2.png

Figure 20: The "d.rbg Module" window showing the required input raster information.

1)

LT RGB 3.png

Figure 21: The RGB map layer output in the "Map Display" window and the selected RGB map layer in the "Layer Manager" window.

1)

LT MapSwipe 1.png

Figure 22: The path to use GRASS Map Swipe with the g.gui.mapswipe module.

1)

LT MapSwipe 2.png

Figure 23: The "Select Raster Maps" window from the Map Swipe module.

1)

LT MapSwipe 3.png

Figure 24: The completed "Select Raster Maps" window.

1)

LT MapSwipe 4.png

Figure 25: The "Map Swipe" window with displaying band 1 of the September 2000 image on the left, and band 1 of the September 2017 image on the right.

1)

LT MapSwipe 5.png

Figure 26: Advanced mode of the "Select Raster Maps" window showing many different options for selecting layers to compare using the g.gui.mapswipe module.

Raster Smoothing and Discontinuity Maps

r.smooth.seg - image pre-processing (takes place before segmentation - smooths out each band individually - also identify segments from each individual band)

1)

LT Smooth 1.png

Figure 27: The "r.smooth.seg Module" window with the completed input and output information on the "Required" tab.

1)

LT Smooth 2.png

Figure 28: The "Settings" tab in the "r.smooth.seg Module" window showing the different variables that can be adjusted.

1)

LT Smooth 3.png

Figure 29: The "Command Output" tab in the "r.smooth.seg Module" window showing the output information.

1)

LT Smooth 4.png

Figure 30: The "Map Display" window with the smoothed map output for band 1 of the September 2000 data using the r.seg.smooth module.

1)

LT Smooth 5.png

Figure 31: The "Map Display" window with the discontinuity map output for band 1 of the September 2000 data using the r.seg.smooth module.


Image Grouping

i.group - group bands 2, 3, 4 together, and create a subgroup containing all 3 of the images (sub-groups required for the cluster step - group and subgroup contain the same (all 3) images)

1)

LT Group 1.png

Figure 32: The path to the i.group module in the "Layer Manager" window.

1)

LT Group 2.png

Figure 33: The "Create or Edit Imagery Groups" window from the i.group module.

1)

LT Group 3.png

Figure 34: The "Add Selected Layers into Group" window from the i.group module.

1)

LT Group 4.png

Figure 35: The "Create Imagery Groups" window showing the creation of a subgroup using the i.group module.

Pre-Processing

i.cluster (Generates spectral signatures for land cover types in an image (the subgroup containing all 3 bands we used above) using a clustering algorithm - this is creates the input for the maxlik tool)

1)

LT Cluster 1.png

Figure 36: The path to the i.cluster module in the "Layer Manager" window.

1)

LT Cluster 2.png

Figure 37: The "i.cluster Module" window showing the input and output information on the Required tab

1)

LT Cluster 3.png

Figure 38: The "i.cluster Module" window showing the variables available on the Settings tab.

Unsupervised Classification

i.maxlik

1)

LT Maxlik 1.png

Figure 39: The path to the i.maxlik module in the "Layer Manager" window.

1)

LT Maxlik 2.png

Figure 40: The "i.maxlik Module" window showing the input and output information on the Required tab

1)

LT Maxlik 3.png

Figure 41: The classified map output for September 2000 created by the i.maxlik module.

1)

LT MapSwipe 6.png

Figure 42: The Map Swipe window showing the classified imagery for September 2000 on the left, and the original imagery for bands 1, 2, and 3 for September 2000 on the right.

Landscape Change Assessment

r.change.info

1)

LT ChangeInfo 1.png

Figure 43: The "r.change.info Module" window with the input and output information on the Required tab for the "PropOfChange40" layer.

1)

LT ChangeInfo 2.png

Figure 44: The "r.change.info Module" window with variable information on the "Moving Window" tab, where step = 40 cells.

1)

LT ChangeInfo 3.png

Figure 45: The "r.change.info Module" window with the "proportion of changes" change assessment selected on the "Optional" tab.

1)

LT ChangeInfo 4.png

Figure 46: The output from the r.change.info module with the "PropOfChange40" layer in the "Map Display" window.

1)

LT ChangeInfo 5.png

Figure 47: The "r.change.info Module" window with the input and output information on the "Required" tab for the "PropOfChange10" layer.

1)

LT ChangeInfo 6.png

Figure 48: The "r.change.info Module" window with variable information on the "Moving Window" tab, where step = 10 cells.

1)

LT ChangeInfo 7.png

Figure 49: The output from the r.change.info module with the "PropOfChange40" layer in the "Map Display" window.

1)

LT ChangeInfo 8.png

Figure 50: The "r.change.info Module window" with the input and output information on the "Required" tab for the "Category15","Size15", and "Category_Size15" layers.

1)

LT ChangeInfo 9.png

Figure 51: The "r.change.info Module" window with variable information on the "Moving Window" tab, where step = 15 cells..

1)

LT ChangeInfo 10.png

Figure 52: The "r.change.info Module" window with "Information Gain for Category Distributions", "Information Gain for Size Distributions", and "Information Gain for Category and Size Distributions" change assessments selected on the Optional tab.

1)

LT ChangeInfo 11.png

Figure 53: The output from the r.change.info module with the "Category_Size15" layer in the "Map Display" window.

1)

LT ChangeInfo 12.png

Figure 54: The output from the r.change.info module with the "Size15" layer in the "Map Display" window.

1)

LT ChangeInfo 13.png

Figure 55: The output from the r.change.info module with the "Category15" layer in the "Map Display" window.


Editing the Landscape Change Maps for Distribution

1)

LT Legend 1.png

Figure 56: The "Category15" layer in the "Map Display" window zoomed out.

1)

LT Legend 2.png

Figure 57: The path to the "Add Raster Legend" module (d.legend) in the "Map Display" window.

1)

LT Legend 3.png

Figure 58: The "Input" tab in the "d.legend Module" window.

1)

LT Legend 4.png

Figure 59: The "Gradient" tab in the "d.legend Module" window showing where the labels for the gradient legend may be altered.

1)

LT Legend 5.png

Figure 60: The "Category15" layer with a gradient legend.


Not Covered in this Tutorial

Additional Resources

Conclusion

References

https://renx.ca/kemptville-building-boom-retail-residential/

Earth Observing System (EOS) Landviewer [2]

GRASS GIS Software [3]