Difference between revisions of "Evaluating Landscape Permeability in Quantum"

From CUOSGwiki
Jump to navigationJump to search
Line 123: Line 123:
 
*Chose the w001001.adf file.
 
*Chose the w001001.adf file.
 
*Then click Open. [[File:Open.png]] These layers will show up in the TOC on the left. The raster layers we added to the project included: Road Density and a DEM.
 
*Then click Open. [[File:Open.png]] These layers will show up in the TOC on the left. The raster layers we added to the project included: Road Density and a DEM.
*In the T of C right click on the layer that says w001001. [[File:w001001.png]]
+
*In the TOC, right click on the layer that says w001001. [[File:w001001.png]]
 
*Click on properties. [[File:Properties.png]]
 
*Click on properties. [[File:Properties.png]]
*Within the layer properties go to the General Tab. [[File:General.png]]
+
*Within the layer properties, go to the General Tab. [[File:General.png]]
*Under Display name give the layer an appropriate name. We named ours DEM. [[File:Displayname.png]]
+
*Under Display Name, give the layer an appropriate name. Fore example, DEM. [[File:Displayname.png]]
*Next go to the Style Tab. [[File:Style.png]]
+
*Next, go to the Style Tab. [[File:Style.png]]
 
*Change the Colour Map to be Pseudocolour. [[File:Pseudocolor.png]]
 
*Change the Colour Map to be Pseudocolour. [[File:Pseudocolor.png]]
 
*Then click OK. [[File:OK.png]]
 
*Then click OK. [[File:OK.png]]

Revision as of 19:27, 5 December 2012

Disclaimer

Vancouver Island Grey Wolf

Please note that this Wiki has been produced for the GEOM4008 Advanced Topics in Geographic Information Systems class at Carleton University strictly as a tutorial to showcase the method of calculating landscape permeability using FOSS. The results should by no means be taken as a true analysis of grey wolf movement since much of the data was fictitious.

Introduction

The objective of this project was to develop a method to evaluate landscape permeability for large carnivores using only Free and Open-Source Software (FOSS). This tutorial has been created to allow non-GIS individuals to successfully complete this analysis in Quantum GIS (1.7.4) using the Grass Plugin. This tutorial will be carried out while analyzing the landscape permeability for grey wolf movement on Vancouver Island. The final result of this project will be a landscape permeability map which will attempt to provide valuable insight into the movement of the Vancouver Island grey wolf. This sort of information could potentially be used to implement more successful conservation strategies, facilitate ecosystem-based management (EMB), and better understand the genetic flow in the island’s population.

Data

Before beginning this tutorial in Quantum GIS (QGIS) a variety of data is needed. In order to evaluate landscape permeability the data must be specific to the area and animal chosen to analyze. After the animal has been chosen, parameters that would inhibit movement in the study area should be studied, and then data must be located. For our analysis of movement on the grey wolf on Vancouver Island, we used a combination of freely available data, as well as self-created data for the purpose of this tutorial. See Table 1 for the data used and the source of the data.


Table 1. Data Used and Data Sources for Vancouver Island Grey Wolf
Data Used Data Format Data Source
Boundary of Vancouver Island Vector Polygon Scholars Geoportal Layer: Dissemination Blocks - Cartographic Boundary File (DB-CBF), 2011 Census / Producer: Statistics Canada
Lakes Vector Polygon Scholars Geoportal Layer: Minor Water Regions (MNWTR) / Producer: DTMI Spatial Inc.
Parks Vector Polygon Scholars Geoportal Layer: Parks and Recreation - Region / Producer: DTMI Spatial Inc.
Landcover Vector Polygon GeoBase Layer: Land Cover / Producer: Circa 2000
DEM Raster GeoBase Layer: Canadian Digital Elevation Data / Producer: Natural Resources Canada
Road Density Raster Created Data
Grey Wolf Range Vector Points & Polygon Created Data
Deforestation on Vancouver Island Vector Polygon Created Data
Hunting Camps Vector Polygon Created Data


Methods

It is highly recommended that these methods are done in order.

QGIS Setup

Before you can begin in QGIS, you must first locate all the data that you wish to use. A good place to start if you are unsure where to find free data would be Scholars GeoPortal* and GeoBase. Once you have found all the data you wish to use, create a folder in your computer and place the data in this folder.

* Note: Scholars GeoPortal data is only available to students attending universities whose libraries are a member of the OCUL.

Opening QGIS

Before beginning, ensure that Quantum GIS is installed on the computer you wish to use. If you do not have QGIS installed, download QGIS.

  • Once the installation has been completed, or if QGIS was already installed, click the QGIS icon to open the program. Icon.png This will open the initial QGIS window.
  • Immediately go to the File Tab. Filetab.png
  • Click Save Project As. Saveas.png
  • Save your project in the folder with all your data.
  • IMPORTANT NOTE: Remember to save your project often. Save.png

Installing the Grass Plugin

Once the initial QGIS window has been opened, it is highly recommended that the GRASS plugin be installed next. The GRASS plugin allows the tools from GRASS GIS to be used within QGIS.

  • Go to the Plugins Tab. Pluginstab.png
  • Click Manage Plugins. Manageplugins.png
  • This will bring you to the QGIS Plugin Manager Window.
  • In filter write GRASS. Filterg.png
  • Click on the GRASS Plugin and make sure there is an x in the box. GRASS.png
  • Finally, click OK. OK.png
  • Now, go back to the Plugins Tab, Plugins.png a new GRASS Tab should have appeared. GRASS1.png
  • Expanding this GRASS menu reveals that most of the tools are greyed out.
  • In order to fix this click on New Mapset. The Mapset is the location where you want your grass files to be stored. NewMapset.png
  • Click Browse Browse.png, and then go to your chosen destination.
  • Once you have browsed to the location, click Next. Next.png
  • Now you will create a new GRASS location. We named ours GRASS. Newlocation.png
  • Then click Next. Next.png
  • This will bring you to the Projection window. Defining your projection is extremely important.
  • Click the circle beside Projection. Projection.png You must chosen the projection based on your study location; for more information on choosing an appropriate projection, see this Guide to Selecting Map Projections. Since our location was in Vancouver Island, we chose Universal **Transverse Mercator (UTM), NAD83 (NSRS2007) /UTM zone 10N. Zone10.png
  • Once you have chosen your projection, click Next. Next.png
  • This will bring you to the Define GRASS Region Window.
  • Scroll to the country of your study area, and click Set. Set.png
  • Then click Next. Next.png
  • This will bring you to the Mapset window.
  • Name your new Mapset. We named ours Mapset. Mapset.png
  • Click Next. Next.png
  • Then click Finish. Finish.png Your new mapset has now been created!
  • Now if you go back to the Plugins Tab, you can see that the tools are no longer grayed out. Depending on the computer you are using you may have to open the mapset every time you open and close QGIS.
  • In order to do this, go to the Plugins Tab. Plugins.png
  • Click GRASS GRASS1.png
  • Lastly, click Open Mapset. OpenMapset1.png

Workspace Setup

Before beginning any data processing, the workspace and data to be used needs to be set up.

Add Vector Layers to QGIS

  • To add vector layers, click the “Add Vectors layer” button at the top left of the screen. Addveclayer.png
  • Browse to the location where you saved your data. Browse.png
  • Click Open. Open.png
  • For this project we added the following vectors: Vancouver Island boundary, lakes, parks, landcover, grey wolf range (both polygon and points), hunting camps, and deforested areas.
  • These layers will appear in the Table of Contents (TOC) on the left.

Add Raster Layers to QGIS

  • To add a raster layer, click the Add Raster Layer button. Addraslayer.png
  • Navigate to the desired folder using the Browse button. Browse.png
  • Chose the w001001.adf file.
  • Then click Open. Open.png These layers will show up in the TOC on the left. The raster layers we added to the project included: Road Density and a DEM.
  • In the TOC, right click on the layer that says w001001. W001001.png
  • Click on properties. Properties.png
  • Within the layer properties, go to the General Tab. General.png
  • Under Display Name, give the layer an appropriate name. Fore example, DEM. Displayname.png
  • Next, go to the Style Tab. Style.png
  • Change the Colour Map to be Pseudocolour. Pseudocolor.png
  • Then click OK. OK.png

Edit Current Grass Region

It is very important to edit the Current Grass Region

  • In order to do so go to the Plugins Tab. Plugins.png
  • Click on Grass. GRASS1.png
  • Then click the Edit Current Grass Region Button. Region.png
  • The extent can be created by drawing an area of interest around your boundary layer.
  • Then click OK. OK.png

Data Processing

Clipping Vector Layers to AOI boundary

  • To clip all the layers to the Area of Interest (AOI) Boundary go to the Vector Tab. Vectortab.png
  • Click Geoprocessing Tools. Geoprocessing.png
  • Then click Clip. Clip.png
  • The Input vector layer is the layer that needs to be clipped. Roads.png For example we had to clip our Roads file as we had all the Roads in BC.
  • The Clip layer is the boundary layer. Cliplayer.png
  • Name the output shapefile in the appropriate location. Browse.png
  • Then Click OK. OK.png

Union

A union must be complete on all of the vector layers that do not have full data coverage of the boundary file.

  • To complete this process go to the Vector Tab, click Geoprocessing Tools, and click Union. Union.png
  • The input vector layer should be boundary file. Boundary.png
  • The union layer should be any layer that does not have full coverage as described above. Union1.png We completed this process for lakes, parks, grey wolf range, landcover, deforestation, and hunting camps.
  • Specify the location and name of the output shapefile. Browse.png An example of how we named ours is Parks_U.
  • Click OK. OK.png
  • A geoprocessing box will pop up asking if you would like to add the new layer to the T of C.
  • Click Yes. Yes.png

Editing the Attribute Table

The attribute table must be edited on all the layers you preformed a union on.

  • To open the attribute table right click on the layer. Openatttable.png
  • Left click on Open Attribute Table.
  • In order to edit click the editor mode on. Edit.png
  • Create a new column by clicking New Column. Newcolumn.png
  • The add Column window will pop up. Give the column a name. We named our CLASS. Columnname.png
  • If you would like you can give the column a comment, however it is not necessary.
  • Ensure the type is set to whole number (integer), Type.png with a width of 1. Width.png
  • The click OK. OK.png
  • In the new column CLASS set the original boundary to be 1 and all the remaining attributes to be 2
  • The boundary can be distinguished by clicking on the numbers on the left side of the window. (seen in red). Class2.png
  • As you click the numbers sections of the map will become highlighted. Highlight.png
  • Again once you have found the boundary put a 1 in the CLASS column and a 2 in the rest of the column.
  • To save changes click the editor mode button again. Edit.png

Import Vectors to Grass

To use the GRASS plugin all the layers must be imported into a GRASS format. For all the vector layers the tool v.in.ogr.qgis must be used.

  • To do so go to the Plugins Tab. Plugins.png
  • Click Grass. GRASS1.png
  • Then click Open GRASS Tools. Grasstools.png
  • Next go to the Modules List Tab. Moduleslist.png
  • In the filter box type v.in.ogr.qgis. Filterv.png
  • Click on the Correct Tool. Grassvec.png
  • The tool will pop up.
  • Use the drop down OGR vector layer arrow to select a layer to change to grass format. Vectlayer.png
  • IMPORTANT NOTE: the layer must be on in the T of C for the drop down to function.
  • Give the output vector map a name. Outputvec.png An example of our naming scheme would be Deforest_U_G.
  • Click Run. Run.png
  • Once the tool has successfully finished click View Output. ViewOutput.png The layer will appear in the T of C.

Import Raster to Grass

To use the GRASS plugin all the layers must be imported into a GRASS format. For all the raster layers the tool r.in.gdal.qgis must be used.

  • To do so go to the Plugins Tab. Plugins.png
  • Click Grass. GRASS1.png
  • Then click Open GRASS Tools. Grasstools.png
  • Go to the Modules List Tab. Moduleslist.png
  • In the filter box type r.in.gdal.qgis. Filterr.png
  • Click on the correct tool. Grassras.png
  • The tool will pop up.
  • Use the drop down loaded layer arrow to select a layer to change to grass format. Grassrasinput.png
  • IMPORTANT NOTE: the layer must be on in the T of C for the drop down to function.
  • Give the output raster map a name a click Run. Run.png An example of our naming scheme would be DEM_G. Grassrasoutput2.png
  • Once the tool has successfully finished click View Output. ViewOutput.png The layer will appear in the T of C.

Convert Vector to Raster

The convert vector to raster does exactly as the name sounds. All the vectors layers must be converted to raster. For our project we converted lakes, parks, landcover, grey wolf range, hunting camps, and deforestation.

  • Go to the Plugins Tab. Plugins.png
  • Click Grass. GRASS1.png
  • Then click Open Grass Tools. Grasstools.png
  • Go to the Modules List. Moduleslist.png
  • In filter type in v.to.rast.attr. Filterv.to.r.png
  • Click the correct tool. V.to.rast.png and the tool will then open.
  • Using the dropdown arrow place the name of the input vector map you wish to rasterize. Inputv.to.r.png
  • Remember the layer must be on for the dropdown menu to work.
  • In the Attribute field place the CLASS layer that you created. Attclass.png
  • Give the output raster map a name. V.to.routput.png
  • Click Run. Run.png
  • Finally click View Output. ViewOutput.png

DEM to Slope

In order to use the DEM for the analysis it must first be changed into slope layer.

  • Go to the Plugins Tab. Plugins.png
  • Click Grass. GRASS1.png
  • Click Open Grass Tools. Grasstools.png
  • Go to the Modules List. Moduleslist.png
  • In the filter box type slope. Filterslope.png
  • Click the Slope Tool. Slope.G.png
  • Input the name of the elevation raster map. For this project our input map was called DEM. Slopeinput.png
  • Name the output slope raster map. Our output map was named slope. Slopeoutput.png
  • The format for reporting the slope can be degrees or percent. We used degrees. Degrees.png
  • Click Run. Run.png
  • Lastly, click View Output. ViewOutput.png

Reclassifying the Rasters According to Cost

In order to assign a cost value to each cell, we must perform a reclass on each raster. Before beginning the reclass, a textfile (.txt) must be written in which the reclass rules will be specified. This subjective process that should be based on scientific literature and expert opinion.

  • For each unique pixel value in a raster, the reclass rules will dictate the assigned cost (i.e. the level of difficulty, from 1 to 10) that a wolf would have traveling across it. For example, any water pixel in the lakes raster, was assigned a cost of 7. The cost value of 7 was assigned because water poses a barrier to wolf movement; however, the wolves can swim if necessary.

Reclassrules.png

  • In the image shown above, the first column on the left indicates each unique pixel value in the raster (recall, for the layers in which a union was required,these values would be 1 (the boundary) and 2 (ex.lakes)). The second column indicates the cost value you wish to reassign to each pixel.
  • If the raster has more than two unique values, then you can assign a single cost value to a range of slope values. This example is demonstrated below using our Slope raster.

Reclassrulesslope.png


Next you must actually run the reclass using the r.class tool.

  • Go to the Plugins Tab. Plugins.png
  • Click Grass. GRASS1.png
  • Click Open Grass Tools. Grasstools.png
  • Go to the Modules List. Moduleslist.png
  • In filter type in r.reclass. Filterreclass.png
  • Click on the correct tool. R.reclass.png
  • Input the raster map to be reclassified. Reclasinput.png
  • For the File Containing Reclass Rules parameter window browse to the location of your saved reclass rules. Reclassrulesinput.png
  • Specify a output raster map name. For example we called ours Huntrange_Reclass. Relcassoutput.png
  • Now click Run. Run.png
  • Then click View Output. ViewOutput.png

Combining the Cost Rasters in the Map Calculator

  • Go to the Plugins Tab. Plugins.png
  • Click Grass. GRASS1.png
  • Click Open Grass Tools. Grasstools.png
  • Go to the Modules List. Moduleslist.png
  • In filter type in r.mapcalculator. Filtermapcalc.png
  • Click on the map calculator tool. R.mapcalc.png
Map Calculator
  • Click Run. Run.png
  • Click View Output. ViewOutput.png

FINALMASTERRASTER2.png

Figure 1: The final Master Cost Raster created by adding all the individual cost rasters together.

Evaluating Least Cost Path and Corridor between Wolf Ranges A and D

The first step in actually evaluating a cost path/corridor, is to calculate an accumulated cost surface from a starting point; this is done using r.walk. The second step is to run r.drain on the results from r.walk; in this step the destination is specified. The output from this will be the least cost path from point A to D. This path should then be converted to a vector in order to create an editable line.

To generate the least cost corridors between ranges A and D, an accumulated cost surface must be created using point D as the starting point. The final step is to add these two accumulated cost surface rasters together, which will create the cost corridor.

r.walk.vect for Wolf Range A

r.walk.vect creates the accumulated cost surfaces.

  • Go to the Plugins Tab. Plugins.png
  • Click Grass. GRASS1.png
  • Click Open Grass Tools. Grasstools.png
  • Go to the Modules List. Moduleslist.png
  • In filter type in r.walk. Filter rwalk.png
  • Click on the r.walk.vect tool. R.walk.vect.png
  • In the Name of Elevation Input Raster Map parameter, select the DEM. Rwalkelevlinput.PNG
  • In the Name of Input Raster Map Containing Friction Costs parameter, insert the master cost raster. Rwalkcostinput2.PNG
  • In the Starting Points Vector Map parameter, select the starting location point. For our example, we wanted to start at Wolf Range A. Rwalkstartingpoint.PNG
  • Specify a output raster map name and deselect the option to Use the 'Knight's move'. For example we called ours rwalk_A. Rwalkoutput.PNG
  • Now click Run. Run.png
  • Then click View Output. ViewOutput.png
  • Once your map has appeared right click on the layer in the T of C.
  • Left click on properties. Properties.png
  • Got to the Style Tab Style.png
  • In the Colourmap box uses the drop down arrow and click colourmap. Colourmap.png
  • Now go to the Colourmap Tab. Colourmaptab.png
  • In the classification mode box use the up arrows to make 8 classes. Classmode.png
  • Click classify. Classify.png

RwalkA.png

Figure 1: The accumulated cost surface raster for wolf range A .

r.drain

r.drain creates the least cost path between the staring point and the destination.

  • Go to the Plugins Tab. Plugins.png
  • Click Grass. GRASS1.png
  • Click Open Grass Tools. Grasstools.png
  • Go to the Modules List. Moduleslist.png
  • In filter type in r.drain. Rdrainfilter.png
  • Click on the r.drain tool. Rdraintool.png
  • In the Name of Elevation Raster Map box uses the drop down arrow to place rwalk_A. Rdraininput.png
  • Give the output raster map a name. An example of our naming scheme would be r.drainAD. Rdrainoutput.png
  • Next you must input the coordinates of the starting points(s).
  • The coordinates can be determined by using the Pan Map tool (in the upper left corner). Handtool.png
  • Hold the Pan Map tool over starting point (in this case your D point). The coordinates can be seen in the left hand corner. Coordinates.png
  • Write these coordinates down and then place them in the starting points box. Startingpoint.png
  • The Result is a path that goes from Wolf Habitat A to Wolf Habitat D. (See below)

Path.png

Figure 2: The least cost path from wolf range A to D.

r.to.vect.line

The r.to.vect.line tool can change the raster path created from r.drain and create a vector line.

  • Click Grass. GRASS1.png
  • Click Open Grass Tools. Grasstools.png
  • Go to the Modules List. Moduleslist.png
  • In filter type in r.to.vect.line. Linetool.png
  • Click on the correct tool. R.to.vect.linetool.png
  • The input raster map should be r.drainAD.Lineinput.png
  • The output vector map can be named adpath. Lineoutput.png
  • Click Run. Run.png
  • Then click View Output. ViewOutput.png

r.walk.vect for Wolf Range D

r.walk.vect must be run to again create the accumulated cost surface. However, instead of running r.walk.vect with Wolf Range A it will be run with Wolf Range D.

  • Look above for the steps to complete this.
  • The only difference is the starting points vector map input. This time use wrD_pnt_G.Walkstartpoint.png
  • Also ensure to name the raster map to contain results differently. We named our rwalk_D. Rwalkresultsname.png
  • The resulting r.walk map for wolf habitat D is shown below.

Rwalk Dmap.png

Figure 3: The accumulated cost surface raster for wolf range D .

Creating the Corridor between Wolf Ranges A and D in Raster Calculator

  • Go to the Plugins Tab. Plugins.png
  • Click Grass. GRASS1.png
  • Click Open Grass Tools. Grasstools.png
  • Go to the Modules List. Moduleslist.png
  • In filter type in r.mapclac. Mapcalc.png
  • Click on the r.mapcalc tool. Rmapcalctool.png
  • In the window create an equation. Add rwalk_A and rwalk_D together. Mapcalcequation.png
  • In the output name the map adcorridor. Mapcalcoutput.png
  • Click Run. Run.png
  • Finally click View Output. ViewOutput.png

ADpath&cor.png

Figure 4: The least cost path from wolf range A to D overlaid on the corresponding least cost corridor map.

Conclusion

FINALOUTPUTMAP.png

Figure 5: The final map showing all the possible least cost paths to each wolf range overlaid on an accumulated least cost corridor raster .

Pawprints.gif

Helpful Links

Download Quantum GIS

Welcome to the Quantum GIS Project

Quantum GIS User’s Manual

Welcome to GRASS GIS

Scholars Geoportal

GeoBase

Carleton Geography

References

Grey Wolf Pic

Animated Paw Prints


[1]

[2]