Difference between revisions of "Talk:Raster Analysis with GRASS tools in QGIS"

From CUOSGwiki
Jump to navigationJump to search
 
(149 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==
 
   
== Introduction ==
 
   
  +
==1 Introduction ==
This Wiki page has been created for Advanced Topics in Geographic Information Systems (GEOM4008) student at Carleton University. The main purpose of this tutorial is to introduce and familiarize future users to understand the Raster Terrain analysis with Geographic Analysis Support Analysis Support System (GRASS) tools in QGIS. A lot of scientific observations and research produces raster datasets. Raster are essentially grids of pixels that have a specific value assigned to them.
 
   
== Objective ==
 
   
  +
This Wiki page has been created for Advanced Topics in Geographic Information Systems (GEOM4008) student at Carleton University. The main purpose of this tutorial is to introduce and familiarize future users to understand the Raster Terrain analysis with Geographic Analysis Support Analysis Support System (GRASS) tools in QGIS. A lot of scientific observations and research produce raster datasets. Rasters are essentially grids of pixels that have a specific value assigned to them.
The objective of this tutorial would be to introduce the procedure of plugin functionalities of GRASS tools with in QGIS workspace and give some examples of Terrain Analysis modules on our area of interest (AOI) – Ottawa, Ontario.
 
  +
   
== Data ==
+
== 2 Objective ==
   
  +
The objective of this tutorial would be to introduce the procedure of plugin functionalities of GRASS tools within a QGIS workspace, and give some examples of terrain analysis modules on our area of interest (AOI) – Ottawa, Ontario.
Certain types of raster allow you to gain more insight into the terrain that they represent. Digital Elevation Models (DEMs) are particularly useful in this regard. In this tutorial we will use DEM to find out more about our AOI.
 
   
== Methods and Data Setup ==
+
== 3 Data ==
'''QGIS Setup'''
 
Before beginning the tutorial install QGIS version 2.8.2, download QGIS to your computer. Please follow the steps below:
 
Click this link to download.
 
Choose which version is compatible with the computer you are working on Follow the steps in the pop-up downloading window
 
   
  +
Certain types of raster allow you to gain more insight into the terrain that they represent. Digital Elevation Models (DEMs) are particularly useful in this regard. In this tutorial we will use a DEM to find out more about our AOI.
'''Opening QGIS'''
 
Once you completed the installation and found all the data you want to use, create a folder in your computer and place the data in this folder.
 
   
  +
== 4 Methods and Data Setup ==
•Click the QGIS icon to open the program. This will open the QGIS window. After the QGIS opened up add the Raster data to QGIS space
 
  +
''' 4.1 QGIS Setup'''
  +
  +
Before beginning the tutorial install QGIS version 2.8.2; first, download QGIS to your computer.
  +
  +
Please follow the steps below:
  +
  +
• [http://qgis.org/en/site/forusers/download.html Click this link to download].
  +
  +
• Choose which version is compatible with the computer you are working on. Follow the steps in the pop-up downloading window
  +
  +
'''4.2 Opening QGIS'''
  +
  +
• Once you completed the installation and found all the data you want to use, create a folder in your computer and place the data in this folder.
  +
  +
• Click the QGIS icon to open the program.[[File:qgis.jpg]] This will open the QGIS window.
  +
  +
• After the QGIS opens up, add the Raster data to QGIS space as detailed below:
  +
  +
  +
'''4.3 Adding Raster Layers to QGIS'''
  +
  +
• Click [[File:addraster.jpg]] Add Raster layer to add the raster data.
  +
  +
• After the data are added,
  +
  +
• right click on the data properties to set the projection to the right projection and coordinate system:
  +
  +
• Go to Properties.[[File:properties.jpg]]
  +
  +
• Go to General, search or select the right coordinate system from coordinate reference system.
  +
  +
[[File:general.jpg|300]]
  +
  +
'''4.4 Installing and Setting up the GRASS Plugin'''
  +
  +
After the initial QGIS window has been opened and data added, next the GRASS Plugin be installed. The GRASS Plugin allows the tools from GRASS to be used within QGIS.
  +
  +
• To add GRASS pluggin , Manage and Intall Plugins.
  +
  +
[[File:pluginnn.jpg]] [[File:grassnhm2.jpg|300px|thumb|right]]
  +
  +
  +
• Enter GRASS in the search menu to install or if the plug is already installed, it will be in the Installed selection to double click it.
  +
  +
• After you installed, the GRASS tools bar layers will appear on the user interface.
  +
  +
[[File:grasstools.jpg|300px|]]
  +
  +
'''4.5 Creating GRASS Database'''
  +
  +
• To create GRASS database, click on the New Map Set.
  +
  +
[[File:nhm16.jpg|400px]]
  +
  +
• In the new map set Browse to your existing directory or create a new one and then click next.
  +
  +
[[File:nhm17.jpg|300]]
  +
  +
• To create GRASS location, click on create new location and name it and the click next.
  +
  +
• Setting up the projection. To this search or select the coordinate reference system using filter tool or by selection from the exiting.
  +
  +
[[File:nhm19.jpg|400px]]
  +
  +
• Set up the extent or the GRASS default region by clicking on: set current QGIS extent and Also the default GRASS region N, W, E and E can be entered.
  +
  +
[[File:nhm.jpg|350px]]
  +
  +
• Finally create the GRASS new mapset by giving it appropriate name.
  +
  +
[[File:nhm21.jpg|350]]
  +
  +
== Data Processing ==
  +
  +
'''5.1 Editing the Current GRASS Region'''
  +
  +
• To speed up processing times a processing extent must be created to tell GRASS what region is being worked with, to do that, click on edit current GRASS region
  +
  +
[[File:nhm22.jpg|300px]]
  +
  +
• Then, when region setting pops up, select the extent by dragging on canvas or change the coordinate value and click OK.
  +
  +
[[File:nhm23.jpg|350px]]
  +
  +
'''5.2 Importing Raster to GRASS Format'''
  +
  +
• To do that, click on the Open GRASS Tools
  +
  +
[[File:nhm24.jpg|400px]]
  +
  +
• When the below pops up, to go File management > Import into GRASS > Import raster into GRASS > Import raster into GRASS from QGIS view.
  +
  +
[[File:nhm25.jpg|400px]]
  +
  +
• To load the raster, clicking on r.in.gdal.qgis-Import loaded raster.
  +
  +
[[File:nhm26.jpg|400px]]
  +
  +
• Then select layer from loaded layer > give output name > Run.
  +
  +
[[File:nhm27.jpg|400px]]
  +
  +
• Now the data that is stored within the GRASS database added and the original files can be removed, by going to the GRASS tool set for vector and raster data.
  +
  +
  +
'''5.3 Exploring Terrain Analysis Tools in the GRASS Modules'''
  +
  +
'''5.3.1 To run these tools.'''
  +
  +
• GRASS Modules > Raster > Spatial Analysis > Terrain analysis. There are a lot of Terrain analysis tools available to various operations.
  +
  +
[[File:nhmterrian.jpg|300]]
  +
  +
5.3.2 Creating slope raster from DEM
  +
  +
• Select r. slope - create slope raster from DEM from Terrain analysis tool box.
  +
  +
[[File:nhm229.jpg|400px]]
  +
  +
  +
• After the tool selected, select the DEM data from elevation raster map > name the output slope raster map > click Run.
  +
  +
• To view the map click on view output.
  +
  +
  +
[[File:nhm310.jpg|400px]]
  +
  +
  +
  +
• To view the new create slope layer map.
  +
  +
[[File:slope.jpg|400px]]
  +
  +
  +
'''5.3.3 Creating Aspect Raster from DEM.'''
  +
  +
• Select r.aspect - create aspect raster from DEM from Terrain analysis tool box.
  +
  +
• After the tool selected, select the DEM data from elevation raster map > name the output slope raster map > click Run. As it shown on the previous steps.
  +
  +
[[File:nhm333.jpg|400px]]
  +
  +
== Conclusion ==
  +
  +
We have successfully demonstrated how to use various Terrain analysis tools offered in the free and open source software of GRASS with in QGIS using a DEM of the Ottawa region. The Raster Terrain Analysis Plugin can be used to calculate the slope, aspect, hillshade, ruggedness index and relief for digital elevation models (DEM). It is very simple to handle and provides an intuitive graphical user interface for creating new raster layers.
  +
  +
== Reference ==
  +
  +
Download QGIS for your platform: http://qgis.org/en/site/forusers/download.html. [Web] accessed: Dec 22, 2015.
  +
GRASS GIS Integration: https://docs.qgis.org/2.8/en/docs/user_manual/grass_integration/grass_integration.html. [Web] accessed: Dec 22, 2015.
  +
QGIS Application : http://hub.qgis.org/projects/quantumgis/wiki/Adding_New_Tools_to_the_GRASS_Toolbox. [Web] accessed: Dec 22, 2015.

Latest revision as of 13:39, 4 January 2016


1 Introduction

This Wiki page has been created for Advanced Topics in Geographic Information Systems (GEOM4008) student at Carleton University. The main purpose of this tutorial is to introduce and familiarize future users to understand the Raster Terrain analysis with Geographic Analysis Support Analysis Support System (GRASS) tools in QGIS. A lot of scientific observations and research produce raster datasets. Rasters are essentially grids of pixels that have a specific value assigned to them.


2 Objective

The objective of this tutorial would be to introduce the procedure of plugin functionalities of GRASS tools within a QGIS workspace, and give some examples of terrain analysis modules on our area of interest (AOI) – Ottawa, Ontario.

3 Data

Certain types of raster allow you to gain more insight into the terrain that they represent. Digital Elevation Models (DEMs) are particularly useful in this regard. In this tutorial we will use a DEM to find out more about our AOI.

4 Methods and Data Setup

4.1 QGIS Setup

Before beginning the tutorial install QGIS version 2.8.2; first, download QGIS to your computer.

Please follow the steps below:

Click this link to download.

• Choose which version is compatible with the computer you are working on. Follow the steps in the pop-up downloading window

4.2 Opening QGIS

• Once you completed the installation and found all the data you want to use, create a folder in your computer and place the data in this folder.

• Click the QGIS icon to open the program.Qgis.jpg This will open the QGIS window.

• After the QGIS opens up, add the Raster data to QGIS space as detailed below:


4.3 Adding Raster Layers to QGIS

• Click Addraster.jpg Add Raster layer to add the raster data.

• After the data are added,

• right click on the data properties to set the projection to the right projection and coordinate system:

• Go to Properties.Properties.jpg

• Go to General, search or select the right coordinate system from coordinate reference system.

300

4.4 Installing and Setting up the GRASS Plugin

After the initial QGIS window has been opened and data added, next the GRASS Plugin be installed. The GRASS Plugin allows the tools from GRASS to be used within QGIS.

• To add GRASS pluggin , Manage and Intall Plugins.

Pluginnn.jpg

Grassnhm2.jpg


• Enter GRASS in the search menu to install or if the plug is already installed, it will be in the Installed selection to double click it.

• After you installed, the GRASS tools bar layers will appear on the user interface.

Grasstools.jpg

4.5 Creating GRASS Database

• To create GRASS database, click on the New Map Set.

Nhm16.jpg

• In the new map set Browse to your existing directory or create a new one and then click next.

300

• To create GRASS location, click on create new location and name it and the click next.

• Setting up the projection. To this search or select the coordinate reference system using filter tool or by selection from the exiting.

Nhm19.jpg

• Set up the extent or the GRASS default region by clicking on: set current QGIS extent and Also the default GRASS region N, W, E and E can be entered.

Nhm.jpg

• Finally create the GRASS new mapset by giving it appropriate name.

350

Data Processing

5.1 Editing the Current GRASS Region

• To speed up processing times a processing extent must be created to tell GRASS what region is being worked with, to do that, click on edit current GRASS region

Nhm22.jpg

• Then, when region setting pops up, select the extent by dragging on canvas or change the coordinate value and click OK.

Nhm23.jpg

5.2 Importing Raster to GRASS Format

• To do that, click on the Open GRASS Tools

Nhm24.jpg

• When the below pops up, to go File management > Import into GRASS > Import raster into GRASS > Import raster into GRASS from QGIS view.

Nhm25.jpg

• To load the raster, clicking on r.in.gdal.qgis-Import loaded raster.

Nhm26.jpg

• Then select layer from loaded layer > give output name > Run.

Nhm27.jpg

• Now the data that is stored within the GRASS database added and the original files can be removed, by going to the GRASS tool set for vector and raster data.


5.3 Exploring Terrain Analysis Tools in the GRASS Modules

5.3.1 To run these tools.

• GRASS Modules > Raster > Spatial Analysis > Terrain analysis. There are a lot of Terrain analysis tools available to various operations.

300

5.3.2 Creating slope raster from DEM

• Select r. slope - create slope raster from DEM from Terrain analysis tool box.

Nhm229.jpg


• After the tool selected, select the DEM data from elevation raster map > name the output slope raster map > click Run.

• To view the map click on view output.


Nhm310.jpg


• To view the new create slope layer map.

Slope.jpg


5.3.3 Creating Aspect Raster from DEM.

• Select r.aspect - create aspect raster from DEM from Terrain analysis tool box.

• After the tool selected, select the DEM data from elevation raster map > name the output slope raster map > click Run. As it shown on the previous steps.

Nhm333.jpg

Conclusion

We have successfully demonstrated how to use various Terrain analysis tools offered in the free and open source software of GRASS with in QGIS using a DEM of the Ottawa region. The Raster Terrain Analysis Plugin can be used to calculate the slope, aspect, hillshade, ruggedness index and relief for digital elevation models (DEM). It is very simple to handle and provides an intuitive graphical user interface for creating new raster layers.

Reference

Download QGIS for your platform: http://qgis.org/en/site/forusers/download.html. [Web] accessed: Dec 22, 2015. GRASS GIS Integration: https://docs.qgis.org/2.8/en/docs/user_manual/grass_integration/grass_integration.html. [Web] accessed: Dec 22, 2015. QGIS Application : http://hub.qgis.org/projects/quantumgis/wiki/Adding_New_Tools_to_the_GRASS_Toolbox. [Web] accessed: Dec 22, 2015.