Difference between revisions of "Landscape Change Assessment using Unsupervised Image Classification in GRASS GIS"

From CUOSGwiki
Jump to navigationJump to search
Line 21: Line 21:
 
|colspan="1"|'''Data File'''
 
|colspan="1"|'''Data File'''
 
|-
 
|-
|GeoTiff file for raster imagery from September 7, 2000 (Landsat 7)
+
|GeoTIFF file for raster imagery from September 7, 2000 with bands 2, 3, and 4 (Landsat 7)
 
|[https://dges.carleton.ca/courses/GEOM4008/landscapeChange/Sept2000.tiff September 2000 File]
 
|[https://dges.carleton.ca/courses/GEOM4008/landscapeChange/Sept2000.tiff September 2000 File]
 
|-
 
|-
|GeoTiff file for raster imagery from September 23, 2017 (Landsat 8)
+
|GeoTIFF file for raster imagery from September 23, 2017 with bands 2, 3, and 4 (Landsat 8)
 
|[https://dges.carleton.ca/courses/GEOM4008/landscapeChange/Sept2017.tiff September 2017 File]
 
|[https://dges.carleton.ca/courses/GEOM4008/landscapeChange/Sept2017.tiff 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]
 
|-
 
|-
 
|}
 
|}
Line 32: Line 38:
 
Once GRASS GIS is properly installed on your computer, you may locate it and open the program.
 
Once GRASS GIS is properly installed on your computer, you may locate it and open the program.
   
[[File:LT_StartGrass.png|800px]]
+
[[File:LT_StartGrass_1.png|800px]]
   
 
''Figure 1: Screenshot of GRASS GIS Startup Interface''
 
''Figure 1: Screenshot of GRASS GIS Startup Interface''
Line 39: Line 45:
   
 
[[File:LT_DefineGrassLocation_1.png|600px]]
 
[[File:LT_DefineGrassLocation_1.png|600px]]
  +
''Figure : The Define New Grass Location window where the user selects a data directory and project location.''
+
''Figure 2: The Define New GRASS Location window where the user selects a data directory and project location.''
   
 
:1)
 
:1)
   
 
[[File:LT_DefineGrassLocation_2.png|600px]]
 
[[File:LT_DefineGrassLocation_2.png|600px]]
  +
''Figure : The Define New Grass Location window where the user chooses a method for creating a new location.''
+
''Figure 3: The Define New GRASS Location window where the user chooses a method for creating a new location.''
   
 
:1)
 
:1)
   
 
[[File:LT_DefineGrassLocation_3.png|600px]]
 
[[File:LT_DefineGrassLocation_3.png|600px]]
  +
''Figure : The Define New Grass Location window where the user selects a georeferenced file.''
+
''Figure 4: The Define New GRASS Location window where the user selects a georeferenced file.''
   
 
:1)
 
:1)
   
 
[[File:LT_DefineGrassLocation_4.png|600px]]
 
[[File:LT_DefineGrassLocation_4.png|600px]]
  +
''Figure : The Define New Grass Location window summary page.''
+
''Figure 5: The Define New GRASS Location window summary page.''
  +
  +
:1)
  +
  +
[[File:LT_DefineGrassLocation_5.png|600px]]
  +
 
''Figure 6: The GRASS Startup window with a Directory, Location, and Mapset selected.''
  +
  +
  +
:1)
  +
  +
[[File:LT_StartGrass_2.png|600px]]
  +
  +
''Figure 7: The GRASS Command window.''
  +
  +
:1)
  +
  +
[[File:LT_StartGrass_3.png|600px]]
  +
 
''Figure 8: The GRASS Map Display window.''
  +
  +
:1)
  +
  +
[[File:LT_StartGrass_4.png|600px]]
  +
  +
''Figure 9: The GRASS Layer Manager window.''
   
 
===Adding Extensions===
 
===Adding Extensions===
   
 
[[File:LT_AddonsExtension_1.png|600px]]
 
[[File:LT_AddonsExtension_1.png|600px]]
  +
''Figure : The path to install new add-ons in GRASS GIS.''
+
''Figure 10: The path to install new add-ons in GRASS GIS.''
   
 
[[File:LT_AddonsExtension_2.png|600px]]
 
[[File:LT_AddonsExtension_2.png|600px]]
  +
''Figure : The "Fetch & Install Extension from GRASS Add-ons" window with search results for the r.smooth.seg add-on. ''
+
''Figure 11: The "Fetch & Install Extension from GRASS Add-ons" window with search results for the r.smooth.seg add-on.''
  +
  +
[[File:LT_AddonsExtension_3.png|600px]]
  +
  +
''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.
 
: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.
Line 68: Line 110:
 
:2) Click the + sign beside the Addons category to expand it.
 
:2) Click the + sign beside the Addons category to expand it.
   
:3) Double-click on the r.smooth.seg add-on to run the selected module.
+
:3) Double-click on the add-on to run the selected module, or select it and press "Run" in the bottom right corner.
   
[[File:LT_AddonsExtension_3.png|600px]]
+
[[File:LT_AddonsExtension_4.png|600px]]
  +
''Figure : The Layer Manager window with the Modules tab open, and the newly installed add-on selected.''
 
  +
''Figure 13: The Layer Manager window with the Modules tab open, and the newly installed add-on selected.''
   
 
===Importing Landsat Rasters===
 
===Importing Landsat Rasters===
Line 79: Line 122:
   
 
[[File:LT_ImportRaster_1.png|700px]]
 
[[File:LT_ImportRaster_1.png|700px]]
  +
''Figure : The path to import raster data using the r.in.gdal module.''
+
''Figure 14: The path to import raster data using the r.in.gdal module.''
   
 
:1)
 
:1)
   
 
[[File:LT_ImportRaster_2.png|600px]]
 
[[File:LT_ImportRaster_2.png|600px]]
''Figure : The r.in.gdal module window showing input and output raster information.''
 
   
 
''Figure 15: The r.in.gdal module window showing input and output raster information on the Required tab.''
d.rgb [https://grass.osgeo.org/grass78/manuals/d.rgb.html]
 
   
 
:1)
 
:1)
   
[[File:LT_RasterMapLayers_1.png|600px]]
+
[[File:LT_ImportRaster_3.png|600px]]
''Figure : The path to add an RGB map layer using the d.rgb module.''
 
   
 
''Figure 16: The r.in.gdal module window showing the Command Output tab.''
   
  +
:1)
   
[[File:LT_RasterMapLayers_2.png|600px]]
+
[[File:LT_Refresh.png|600px]]
''Figure : The d.rbg module window showing the required input raster information.''
 
   
  +
''Figure 17: The "Refresh" button on the Data tab in the Layer Manager window.''
   
   
  +
:1)
[[File:LT_RasterMapLayers_3.png|800px]]
 
''Figure : The RGB map layer output in the Map Display window.''
 
   
  +
[[File:LT_DoubleClickLayers_1.png|600px]]
===Raster Smoothing and Discontinuity Maps===
 
r.smooth.seg - image pre-processing (takes place before segmentation - smooths out each band individually)
 
   
  +
''Figure 18: The Map Display window and Layer Manager window showing the Sept2000.1 layer.''
   
   
  +
===Segmentation===
 
 
d.rgb [https://grass.osgeo.org/grass78/manuals/d.rgb.html]
i.segment (identify segments from each individual band)
 
  +
  +
:1)
  +
  +
[[File:LT_RGB_1.png|600px]]
 
''Figure 19: The path to add an RGB map layer using the d.rgb module.''
  +
  +
:1)
  +
  +
[[File:LT_RGB_2.png|600px]]
  +
''Figure 20: The d.rbg module window showing the required input raster information.''
  +
  +
:1)
  +
 
[[File:LT_RGB_3.png|800px]]
  +
''Figure 21: The RGB map layer output in the Map Display window and the selected RGB map layer in the Layer Manager window.''
  +
 
===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)
  +
   
 
===Image Grouping===
 
===Image Grouping===

Revision as of 20:04, 15 December 2019

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: Screenshot of 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.


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.

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)


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)

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)

Unsupervised Classification

i.maxlik

Landscape Change Assessment

r.change.info


Map Swipe

Map Swipe tool

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]