SAGA

The System for Automated Geoscientific Automation (SAGA) environment contains powerful tools, some of which have very specific applications; for example, geostatistical analyses and fire or erosion modeling. However, we will explore some of the SAGA tools that have broader applications and often dovetail nicely with tools from other providers. Similar to GRASS, integrating the SAGA algorithms within the Processing Toolbox provides access to powerful tools within a single interface.

To explore some of the SAGA algorithms available through the toolbox, we will work through a hypothetical situation and perform the analysis to evaluate the potential roosting habitat for the northern spotted owl.

We are going to continue using data from the provided ZIP file, and we will need the following files:

  • Elevation file (dems_10m.dem available in the GRASS data folder)
  • Hillshade file (hillshade.tif created in the GRASS section)
  • Boundary file (crlabndyp.shp)
  • Surface water file (hydp.shp)
  • Land use file (lulc_clnp.tif available in the GRASS data folder)

Evaluating a habitat

GIS has been used to evaluate potential habitat for a variety of flora and fauna in diverse geographic locations. Most of the habitats are more sophisticated than the approach we will take in this exercise, but the intention is to demonstrate the available tools as succinctly as possible. However, for simplicity's sake, we are going to assume that the resource management office of Crater Lake National Park has requested an analysis of potential habitat for the endangered Northern Spotted Owl. We are informed that the owls prefer to roost at higher elevations (approximately 1,800 meters and higher) in dense forest cover, and in close proximity to surface water (approximately 1,000 meters).

In order to accomplish this analysis, we need to complete the following steps:

  1. Calculate elevation ranges using the SAGA Raster calculator tool.
  2. Clip land use to the park boundary using Clip grid with polygon.
  3. Query land use for only surface water using SAGA Raster calculator.
  4. Find proximity to surface water using GDAL Proximity.
  5. Query the proximity for 1,000 meters of water using GDAL Raster calculator.
  6. Reclassify land use using the Reclassify grid values tool.
  7. Combine raster layers using SAGA Raster calculator.

Calculating elevation ranges using the SAGA Raster calculator

There are multiple ways to create a layer that represents elevation ranges or, in this case, elevation zones that relate to potential habitat. One method would be to use r.recode as we did in the GRASS exercise; another would be to use the Reclassify Grid Values tool provided by SAGA, which we will use later in this exercise; but, another very quick way is to only identify the areas above a certain elevation—in this case, greater than 1,800 meters—using a raster calculator. This type of query will produce a layer with a binary level of measurement, meaning the query is either true or false. To execute the raster calculator, select the layer representing elevation only in the park, enter the formula gt(a, 1800), name the output file, and click on OK.

The syntax we entered in the formula box tells the SAGA algorithm to look at the first grid—in this case a—and if it has a value greater than (gt) 1,800 meters, the new grid value should be one, otherwise it should be zero. The following screenshot illustrates how this appears in the SAGA Raster calculator window. We could have also used the native QGIS Raster calculator tool. So, the intent here is to demonstrate that there are numerous tools at our disposal in QGIS that often perform similar functions. However, the syntax is slightly different between the QGIS, GRASS, and SAGA raster calculators; so, it is important to check the Help tab before executing each of the tools.

Calculating elevation ranges using the SAGA Raster calculator

Clipping land use to the park boundary using Clip grid with polygon

After executing this tool, we will be presented with a new raster layer that identifies the elevations above 1,800 meters with a value of 1 and all other values with a value of 0. The next step is to clip the land use layer using the SAGA Clip grid with polygon tool. If you remember, we clipped a raster layer in a previous exercise using the native GDAL Clipper tool, so again this is merely demonstrating the number of options we have to perform spatial operations.

We need to select land use (lulc_clnp) as our input's raster layer, the park boundary as our polygon's layer, name the output file as lulc_clip.tif, and click on OK. Remember from an earlier exercise that you can load the lulc_palette.qml file if you would like to properly symbolize the land use layer, but this step isn't necessary.

Querying land use for only surface water using SAGA Raster calculator

Now, we can query this layer for the areas that represent surface water. We can again use the SAGA Raster calculator tool and enter (a, 11) in the Formula box, as illustrated in the next screenshot. In this example, we are stating that if the land use layer (that is a) is equal to 11, the resulting output value will be 1; otherwise it will be 0.

Querying land use for only surface water using SAGA Raster calculator

Now, we have a raster layer that we can use to identify potential habitat within 1,000 meters of surface water.

Finding proximity to surface water using GDAL Proximity

To accomplish this, we need to create a layer representing proximity to surface water and query that layer for areas within 1,000 meters of any surface water. Our first step is to execute the GDAL Proximity (raster distance) tool in the Processing Toolbox. We need to select the binary (true or false) layer representing surface water (lulc_sw.tif), set the Values field to 1, leave the Distance units field as GEO, change the Output raster type to Int32, leave all the other defaults as they are, and name the output layer as illustrated in the next screenshot:

Finding proximity to surface water using GDAL Proximity

The rationale for setting Values to 1 and Distance units to GEO is that we are asking the algorithm to assume that the distance is measured in increments of 1 based on the geographic distance—in this case, meters—and not on the number of pixels. We can now query the resulting grid for the area that is within 1,000 meters of surface water, but it is important to recognize that we want to identify the areas that are less than 1,000 meters of surface water but greater than 0. If we just query for values less than 1,000 meters, we will produce an output that will suggest that the roosting habitat exists within bodies of water.

Querying the proximity for 1,000 meters of water using GDAL Raster calculator

The easiest way to perform this query is by using the native QGIS Raster calculator tool by clicking on Raster Calculator under Raster. The following screenshot illustrates how to enter the "Proximity to Water@1" > 0 AND "Proximity to Water@1" <= 1000 syntax to identify a range between 0 and 1,000 meters:

Querying the proximity for 1,000 meters of water using GDAL Raster calculator

The resulting output will contain the values of 0 and 1, where 1 represents the cells that are within 1,000 meters of surface water and 0 represents those that are beyond 1,000 meters. The next screenshot illustrates what this layer looks like after you set the value of zero to transparent and the buffer itself to red:

Querying the proximity for 1,000 meters of water using GDAL Raster calculator

The last habitat variable that we need to evaluate is the preference towards roosting in dense forest cover. We are going to reclassify or recode the land use layer assuming that the owls will make use of three primary classes that are deciduous, evergreen, and mixed forest types in decreasing preference. This means that we are going to use a simple ordinal ranking scheme to assign a new value of 3 to grid cells that represent evergreen forest, a value of 2 for shrub cover, a value of 0 for water, and a value of 1 for the remaining land types. We could assume zero for all other cover types, but owls are unpredictable.

Reclassifying land use using the Reclassify grid values tool

To accomplish this, we could use r.recode as we did in a previous exercise, but instead, we are going to use the SAGA Reclassify Grid Values tool. The advantage of this tool is that we can enter our reclassification rules directly in the tool interface, rather than reading them into the algorithm from a separate file. The following screenshot provides the necessary values to reclassify the land use layer, where 11 represents surface water, 42 represents evergreen forest, 52 represents shrub cover, and all other values are equal to 1. The minimum and maximum columns represent a range of values and within those ranges the resulting pixels will be given the value in the new column:

Reclassifying land use using the Reclassify grid values tool

Tip

If your version of QGIS doesn't allow you to add or remove rows, remember that you can also use the GRASS r.recode tool after creating a recode rule file. This might be a good exercise to work through to make sure you understand the formatting requirements for GRASS recode rule files. For a more in-depth explanation, visit http://grass.osgeo.org/grass65/manuals/r.recode.html.

To use the SAGA Reclassify grid values tool, we need to provide an input grid, which in this case is the clipped land use layer (lulc_clip.tif), and set Method to [2] simple table. The values that need to be reclassified (shown in the previous screenshot) can be entered by clicking on the Fixed table 3x3 button located below the Lookup Table prompt. Make sure you provide a name for the new reclassified grid, for example, lulc_rec.tif.

Combining raster layers using SAGA Raster calculator

Now, we have all the necessary layers to finalize our simplistic model of Northern Spotted Owl habitat. Since we have zero values that need to be preserved, that is, places where owls will never roost, we will multiply the three layers together using the SAGA Raster calculator tool. The next screenshot illustrates how to populate the raster calculator by selecting the reclassified elevation layer (elev_1800.tif) as the main input layer and then selecting the reclassified water proximity (buf_water.tif) and land use (lulc_rec.tif) layers by clicking on the ellipsis button () next to Additional layers [optional]:

Combining raster layers using SAGA Raster calculator

We could have used the native GDAL Raster calculator tool or the GRASS r.mapcalculator tool, but once again, this demonstrates how easy it is to switch between the various toolbox options. Similar to the GRASS syntax, the SAGA algorithm identifies the inputs in the order they are selected as a, b, and c. To ensure that we understand the values reported in the resulting output from this calculation, we need to remember the reclassified water and elevation layers are binary, so it will have the values of 0 and 1, while the reclassified land use layer contains the values from 0 to 3. Therefore, the new layer can only contain values of from 0 to 3 where 0 indicates no habitat, 1 indicates poor habitat potential, 2 indicates moderate habitat potential, and 3 indicates good habitat potential, as illustrated in the next screenshot:

Combining raster layers using SAGA Raster calculator

Hopefully, it is clear that this is a very simple model with many assumptions that any ornithologist who actually studies the Northern Spotted Owl would not actually use to evaluate habitat. However, the various tools and general approach that has been taken to evaluate this hypothetical scenario could be applied by paying more rigorous attention to the underlying assumptions about the variables that influence potential habitat. The goals of working through this type of analysis were threefold: to showcase a variety of useful SAGA algorithms, to demonstrate that there are similar tools with subtle differences that are available through the toolbox, and to illustrate how easy it is to switch between native QGIS tools and those found in the toolbox.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.25.32