Masthead

Lab 8: Conservation/Research Areas - Part 3 - Selecting Sites

Introduction

In the previous two labs, we found out where to acquire data, we performed a standardized quality control and quality assurance procedure, and we created data that we needed to complete the study. In this lab, we'll determine the best locations for studying and preserving the Coastal Giant Salamander (Dicamptodon tenebrosus). They like it wet so we need to find the best locations for them in Arcata Forest.

Image of a giant salamander and a hand

Photo courtesy of http://www.californiaherps.com.

Note: the instructor is not a biologist but thinks these salamanders are seriously cool. He created this lab based on what he could find out about the salamanders and then made up a few things to cover the GIS tools that you'll need in a wide variety of applications.

Learning Outcomes

After completing this lab, the student will be able to:

Flow Chart

This lab has a lot of steps to it. You'll need to setup a workspace and then copy and project files either at the start of lab or as you need them. It is highly recommended that you create a new folder for this lab, make sure to keep everything you are working with in the same spatial reference, and go a good job naming data sets. I tend to add names to the end of a data set for each new step (i.e. Stream.shp, Stream_Buffer3m.shp, Stream_Buffer3m_Clip.shp). When I make a mistake I add a number to the end of the new data sets (i.e. Stream_Buffer1.shp, Stream_Buffer2.shp, etc.).

Creating the Stream Layer for Research

The flow chart below outlines the first half of the lab, creating a stream layer that includes the portions of the stream that are appropriate for research.

Selecting Sites

The second step is to select our final research sites.

Setting up Your Workspace

Setup you workspace as in the past and include the data sets from the previous lab.

  1. Create a workspace and then copy the streams, DEM, hillshade, and watersheds from the previous lab into the new workspace.
  2. You'll also need the Arcata forest boundary, trails, and roads layers and the parcels shapefile for Humboldt County.
  3. Make sure all these layers are in WGS 84 UTM Zone 10 North and place them in your working folder.

Note: For this lab, all work will be done using the spatial reference system:
WGS 84 UTM Zone 10 North

Habitat Near Streams

Defining the Habitat Near Streams

The next step is to define the habitat near streams. This would normally be much more complex to take into account the topography around a stream (i.e. the habitat would be narrower where the stream bank was steeper) but we'll simplify it here to just a horizontal buffer (which is used a lot for this type work, even when it probably should not).

  1. Load the stream layer you created in the previous lab into ArcMap.
  2. From the Geoprocessing menu, select "Buffer".
  3. Use your steam layer as the "Input Features".
  4. Give the "Output Feature Class" a good name, like "Streams_Buffered_3m.shp".
  5. Enter 3 meters for the "Linear Units" and select "OK".
  6. Zoom in an note that your buffered streams are now polygons around your original streams layer. Buffering is another commonly used tool in GIS and can be used on points, polylines, and polygons.
  7. Also notice that your streams have been "rounded" at the ends and now overlap the boundary of Arcata Forest. Go ahead and "Clip" them to the forest boundary now.
  8. Then, zoom into where two of your stream reaches come together, see anything that might be a problem? The stream reaches were buffered individually and now overlap at the ends. If you compute the area using these polygons, the area will be larger than it should be. Use "Dissolve" to combine all the buffered stream areas into a single polygon.
  9. Zoom in and checkout your stream buffers and see if they look correct.
  10. As we did with "Length" for polylines in the last lab, add a "Field" to the "Attribute Table" and compute total the "Area" for these polygons. This will be the total area that we have for potential habitat.

Erasing Human Areas

Salamanders and humans (especially ones with dogs) do not mix well. Even though the city requires that dogs are always on a leash, visitors often violate that rule.

  1. Buffer your roads to 30 meters (typical road easements are 15 meters plus another 15 for dogs to get off the trail) and buffer your trails to 15 meters
  2. "Erase" the buffered road and trail shapes from the salamander habitat, enter the "Search" window and type "Erase". If you know the name of a tool in ArcGIS, this is the fastest way to find it. If you don't know the name, search the web for "ArcGIS <whatever you can come up with that might match the tool>" and you should find someone that has used the tool.
  3. After the erase, zoom in an you should see the areas of the stream buffer have been erased around the roads and trails.

You should now have the habitat for salamanders that will avoid human trails and roads.

Note: If you open the attribute table, you'll see that your calculated area for the habitat has not changed! This will only update after you run the Calculate Geometry tool.

 

The Forest Boundary vs. the Parcels

  1. Load the Arcata Forest boundary and the Humboldt County parcels layer.
  2. Put the Arcata Forest boundary on top of the parcels layer and set it's fill to "no color".
  3. How well do the boundaries between the two shapefiles line up? You might think this is unusual but it is not and it's often very difficult to find out what the "right" answer is.

For your report, note the maximum distance you can find between the lines in the two shapefiles.

We need to create a new boundary for Arcata Forest that matches the parcels shapefile as this might result in two different results.

  1. First, we need to select the parcels and only those parcels that make up Arcata Forest in the county parcels layer. We also want to see the Arcata Forest boundary as we do this but it will be selected as well unless we turn off it's option for being selected. To do this, select the "List by Selection" icon in the table of contents.
  2. Then, you can click on the little "select" icons to make the other layers you have loaded "unselectable".
  3. The "list by selection" tab int he table of contents
  4. Now, select the "Select Features" tool and click on one of the parcels that makes up Arcata Forest.
  5. Hold down the "shift" key and select the other parcels until you have all of the parcels that make up Arcata Forest. Make sure you get them all as some of them are small.
  6. If you're not sure which parcels are in the city, you can use the "info" tool to examine the parcels information and see which ones have a land use that indicates the parcel is in the Arcata Community Forest.
  7. Then, return to the regular view in the Table of Contents and right click on the parcels layer and select "Data -> Export Data".
  8. Image of selecting "Export Data"
  9. Note that the "Export:" popup has "Selected features" selected. This allows us to write out a new shapefile with just the features we want.
  10. Give the new file a good name like "AracataForest_FromParcels.shp" and save it in your working folder.

Note: We do not recommend using "Create layer from selected features". This creates a temporary layer that stops working and crashes in a number of the tools. The process above is much more robust.

Note: This process of selecting data within a layer, creating a temporary layer, and then exporting it to a new shapefile is really common in GIS.

  1. To make this into a single polygon, select "Geoprocessing -> Dissolve".
  2. Just select your new shapefile as the "Input Features", give the "Output Feature Class" a good name, and click "OK".
  3. Take a look at the two boundaries and plan to include a map of their difference and the different computed areas in your report.
  4. Make sure to select "Selection -> Clear Selected Features" to clear the currently selected features.

Erasing the range of house cats in the parcels that border Arcata Forest

One of the issues with salamanders are predation by cats. Domestic cats will range a mean of 286 meters with a standard of deviation of 58 meters (Barratt, 1997). To remove this, we'll need to create a shapefile with the residential areas around the forest, buffer it, and then erase it from our habitat.

Finding the Buildings

Now we need to create a shapefile that just contains the buildings that might have house cats on them (we're going to ignore the feral cats).

  1. Load the Polygon layer from two weeks ago when we digitized the buildings and merged the result.
  2. Open the attribute table and find the rows that have a "Type" of "Building". Note if anyone used a different term for a building.
  3. Open the "Select by Attribute" tool in the upper left of the attribute table. This is a power tool for selecting features based on a verity of criteria. The easiest way to use the tool is to click on the buttons rather than typing.
  4. Click on the "Type" field in the panel at the top.
  5. Click on the "=" and note that the tool is adding text to the "WHERE" clause.
  6. Click on "Get Unique Values". This will fill the panel on the right with all the values that appear in the selected field.
  7. Click on the value that you want to search for.
  8. If you need to search for more than one value at a time, you can click on "Or" and then add another "Type = Value" statement. Note that you cannot use "Type = 'Building' or 'Buildings'" as computers are stupid and need each simple statement repeated for them.
  9. Click "Apply" and then click the "Show selected records" at the bottom of the attribute table. You should now just see the features that have Type values set to "Building".
  10. Open the "Select by Attribute" dialog again and take a look above the bottom panel. It should show "SELECT * FROM parcels WHERE". ArcMap implements a subset of the Structured Query Language (SQL) that is used in almost all databases. This is a powerful language that allows us to create complex "queries" to subset our data.

Removing the House Cat Home Range

We can now buffer our house cat home range to 286 meters to make sure our areas are at least beyond the mean range of house cats from their home.

  1. Buffer the residential shapefile to 286 meters and erase it from the buffered stream layer.

You should now have a habitat map for salamanders that avoids humans, dogs, and cats. Remember to clip the habitat layer to the original Arcata Forest boundary and recompute the new area of habitat.

Final Stream Layer

As a final step, clip your streams layer to the buffered steams layer so we have streams to work with within our buffered area.

Note: You now probably have a large number of layers in ArcMap. This is a good time to remove most of them and just keep those we are going to use moving forward (i.e. the streams and buffered steams with areas erased that are poor habitat).

Selecting Research Sites

The next step is to define the sites where we will setup monitoring locations for salamanders. We want these to be along the streams and to be randomly placed. However, we also want to sample the full range of elevation that is available in the forest.

  1. Load the stream layer you created above with all the buffered areas removed.
  2. Create a new point shapefile making sure to set the spatial reference to match the other data sets and name it "Research_Sites.shp"
  3. Make sure you clear any selected features and then start an edit session.
  4. Select one of the stream reaches and then select "Construct Points..." in the "Editor" menu.
  5. Selecting the "Construct Ponits" option in ArcGIS
  6. Enter "20" for the distance (i.e. 20 meters because we are in UTM).
  7. Leave the other settings as they are and click "OK".
  8. You should see points added to the point shapefile along the stream reach at a distance of 20 meters.
  9. Repeat this for all the stream reaches until you have something that looks like the map below.
  10. Make sure to stop your editing session.

Random Attributes

We have far too many points for us to use for research but we want to have a statistically valid study of the area so we need to use a random approach to selecting the final sites.

  1. Add a new attribute with the name "Random" and the type of "Short Integer".'
  2. Right-click on the attribute header and select "Field Calculator". This will open another powerful tool in ArcGIS. This one allows you to compute new attribute/field values from other values.
  3. Image of how to find the Field Calculator
  4. Field Calculator is similar to "Select by Attribute" in how you use it. Notice the "Random=" label over the panel in the bottom half of the dialog box. This is where you can type equations to compute the values in the attribute table. Type in "12" and then press "OK". You should see all the values for "Random" be set to 12.
  5. We're going to need to compute some random numbers which is not directly supported by the Field Calculator but can be computed using a little Python code which can be executed inside the Field Calculator (which is really cool!).
  6. Select "Python" for the "Parser" and then check "Show Codeblock".
  7. Enter the code shown below in the "Pre-Logic Script Code:" panel. This is a Python function that will generate a random number that falls between a minimum and maximum value that you specify. The "import random" line imports the "random" function library into Python. The line with "return" calls the library to create a random number and then returns the value. Note that there are spaces in front of the second two lines. These let the parser know that these lines are part of the function and are very important.
  8. def RandomInt(Min,Max):
     import random
     return random.randint(int(Min),int(Max)) 	
  9. Enter the code "RandomInt(0,100)" into the panel labeled "Random =". This code will call your function for each of the cells in the column that is selected (Make sure that you have the field labeled "Random" selected).
  10. Image of field calculator with the Python code to generate random numbers
  11. When done, you should see random (really pseudo random) values appear in the column.
  12. Right-click on the column header and select "Sort Ascending".
  13. Select the first 10 rows in the attribute table. You should see 10 points along our steams highlight that are randomly placed.
  14. Export these to a shapefile as your final research sites.

Stratified Random Sampling (Extra Credit/Optional)

You may want to use stratified random sampling to say, make sure you include samples from different elevations.

  1. The next step is to add the elevations from our DEM into the point file so we can select our sites. Load the filled DEM we created before.
  2. Search for "Extract Points" and you'll see the tool "Extract Values to Points". Note that the search string does not have to match exactly, it just has to include a couple words in the name of the tool. Select the tool "Extract Values to Points".
  3. Run the tool to create a new point shapefile.
  4. Open the attribute table in the new shapefile and you should see a new column with the title "RASTERVALU". This column contains the values from our DEM that match the points!
  5. The next step is to find the minimum and maximum elevation values. Right click on the "RASTERVALU" column heading and select "Statistics". This will show you the minimum and maximum values in the column. Record these values somewhere.
  6. Create a new attribute called "Bins" as a "Short Integer".
  7. Open the Field Calculator.Now double click on "RASTERVALU" in "Fields". Notice that ArcMap puts brackets around the field name. This indicates that these values should be replaced by the value from the "RASTERVALU" column. When you click "OK" you should see the values from "RASTERVALU" move into the "Bins" column but they will be converted to integer values because that is the type of the "Bins" attribute.
  8. We want to make sure we have at least one bin in every 40 meters of elevation so we'll create a categorical attribute for each elevation band and then select sites within each band. Enter the following equation into Field Calculator replacing "Min" with the minimum RASTERVAL. Replace the Max-Min value with the maximum raster value minus the minimum value. This is the "range" of values within the raster. Replace the NumBins-1 with 4 (i.e. 5-1). The equation first subtracts the minimum value to move all elevations to 0 and then divides by the range of values. This converts the values to go from 0 to 1. Then, multiplies by the number of bins-1, 5 for this lab, to make the values go from 0 to 4 (notice that this is five bins). Recognize that the range of elevations for the bins will vary based on the range of values for your sites.

( [RASTERVALU] - Min) / (Max-Min) * (NumBins-1)

In the next series of steps we are going to use "Select by Attribute" to select points that are in the same bin and then set the "Site" value to 1 for the two points with the lowest random values. We'll repeat this for each bin until we have our final sites.

  1. Create a new attribute called "Site" with the type of "Short Integer".
  2. Start an edit session.
  3. Use "Select by Attribute" to select the features that have a bin value of 0.
  4. Make sure you have "Show selected records" selected at the bottom of the attribute table.
  5. Right click on the "Random" field header and select "Sort Ascending".
  6. Double click on the first row's "Site" value and change it to 1. Note that you can only edit these values in an edit session.
  7. Change the second row's "Site" value to 1 as well. Now we have 2 sites selected in the first bin.
  8. Repeat from step 3 for each of the bins.
  9. After you've setup the "Site" attribute, select all the sites that have a value of 1 in "Site" and create a new shapefile from the selection.

Final Map

Create a final map of your study site and include labels for each of the study sites.

References

Barratt, D. G. 1997 Home range size, habitat utilization and movement patterns of suburban and farm cats Flis catus. Ecography, 20:271-280. <http://onlinelibrary.wiley.com/doi/10.1111/j.1600-0587.1997.tb00371.x/epdf>

Random Number Generator for the Field Calculator

© Copyright 2018 HSU - All rights reserved.