Masthead

Lab 7: Research Sites, Part 2 - Creating Streams and Watersheds

Introduction

In the previous lab, we learned where to acquire data and how to perform a standardized quality assurance and quality control procedure. Now that we have the data, we will prepare it for analysis by projecting the data into the same projection and coordinate system. Once this is done, we will create some additional data sets and run some basic calculations.

The key questions we are trying to ask with this lab are:

  1. How many streams are there in Arcata Forest and what is their total length?
  2. What are the watersheds in Arcata Forest and how large are they?

Learning Outcomes

Clipping The Wetlands Data

One of the layers we want to look at are the wetlands for California but the data set is huge! If you have not done so already, "clip" it to just Humboldt County.

  1. In ArcGIS Pro, select the "Analysis tab"
  2. Click on the "Clip" tool
  3. For the "Input Features" use the "CA_Wetlands" shapefile (depending on the downloaded file, it may be "CA_Wetlands_North").
  4. For the "Clip Features" use the Humboldt County Boundary.
  5. Set the "Output Feature Class" to "Humboldt_WetLands.shp" and save it in the "Humboldt_County" "Originals" folder.
  6. When you click "OK", ArcGIS will take a few minutes and then should display a wetlands shapefile for just Humboldt County that will load and redraw much faster than the one for all of California.

Walk Through: Projecting Vector Data

It is important that each layer in any analysis you perform have the same spatial reference system. This will minimize uncertainty and error. Any error related to map projections will at least be uniform throughout the analysis if they all share the same spatial reference system.

In this step we will project each of our data sets into WGS84 UTM Zone 10 North. This is an international coordinate system based on the Transverse Mercator projection. It is particularly accurate for regions with a North/South orientation, such as Humboldt County. UTM always uses meters as the linear unit.

  1. Using the folder structure from the last lab, download the Arcata Forest data and add it to your "1_Originals" folder. I have checked these data sets and they are all in "NAD83_StatePlane_California_I_FIPS_0401_Feet" and appear OK except that some of them cover a larger area than just the forest.
  2. Also, download the Humboldt County parcels and roads layer (or copy them from a previous lab).
  3. Create a "2_Working" folder next to your "1_Originals" folder.
  4. In ArcGIS Pro, select the "Analysis" tab, click on "Tools".
  5. Search for "Project" and select the "Project" tool.
  6. Select the clipped "CA_Wetlands" data set for the "Input Dataset"
  7. Save the output data set to your "2_Working" folder and give it a good name such as "Humbolt_County_Wetlands.shp"
  8. Make sure to set the "Output Coordinate System" to WGS 84, UTM Zone 10 North
  9. Repeat this process for the following data sets (note that the names of the original files may have changed):
    1. apnhum53sp.shp -> Humboldt_Parcels.shp
    2. humtrans3sp_20130417.shp -> Humboldt_Roads.shp
    3. From the Arcata Forest data set:
      1. cfroads83v7 -> Forest_Roads.shp
      2. creeksp83v13 -> Forest_Creeks.shp
      3. cftrails83v8.shp -> Forest_Trails.shp (I believe this is "version 8" but I did not see any differences between this an "v7")
      4. ACF_boundarysp83v3.shp -> Forest_Boundary.shp
      5. waterbodysp83v10.shp -> Forest_Waterbodies.shp

Once the project tool is complete, you should see a copy of each of these layers in your "2_Working" folder.

Ready for Analysis?

When completed, you should have folders in your "2_Working" folder that contain data for Humboldt County and Arcata Forest. All the data should be in the same spatial reference and ready for us to do some Spatial Analysis!

A great thing to do before proceeding is to go to "Project -> New", create a new map, and then load all your files from the "2_Working" folder into the program. You should not receive any warnings or errors. If you do, something went wrong and you'll want to fix it before proceeding.

Streams Data

Streams data is very important to natural resource research but it is also very challenging to find a "good" stream layer, especially at high resolution. In this step, we'll take a look at some existing stream layers and then create one of our own.

Comparing Water Body Layers

  1. In your GIS application, load the data sets for:
    1. Arcata Forest Boundary
    2. Arcata Forest Creeks
    3. California Wetlands that were clipped to Humboldt County
  2. Zoom in to the layers and take a minute to examine the layers.

The bottom line is that none of the water body layers we have are going to work for the research we want to do in Arcata Forest. Because of this, we need to create a new stream layer. I recommend walking through these steps rather carefully as a wrong turn can cause your computer to crash or take a really long time to finish processing.

Finding Watersheds in ArcGIS Pro

Clipping a DEM

First, to make the stream network processes move fast, we need to clip a DEM to just the area around Arcata Forest.

  1. Create polygon shapefile and then create a rectangle that represents the data you want to clip the raster to. Because we will be making watersheds that include area around the forest, make sure to leave a large buffer by making the polygon about 3 times the width and height of the forest. Make sure to save your edits.
  2. Clipping rasters is different from clipping vectors so open the search box and type in "Clip Raster"
  3. The first item should be "Clip Raster" in "Data Management". Select this tool.
  4. Select the DEM from last week that overlaps with Arcata Forest as the "Input Raster" and the clipping boundary" as the "Output Extent". Then, set the "Output Raster" to "DEM_Clipped.img" in your Arcata Forest working folder.
  5. The clipped DEM should appear around your Arcata Forest boundary.
  6. You can now remove the larger DEM from ArcGIS.

Walk Through: Projecting Raster Data

To project a raster to a new spatial reference, we need to use the "Project Raster" tool.

  1. In Geoprocessing search for "Project" and select "Project Raster".
  2. Select the "DEM_Clipped.img" for the "Input Raster"
  3. For the "Output Raster Dataset" be sure to save to your working folder. Call the output "DEM_Clipped_Projected.img". The "img" or "Imagine" file format is the best file format for rasters when working with ArcGIS.
  4. For the "Output Coordinate System", open the Spatial Reference Properties window by clicking the icon on the right. Just as before, we can use the "Layers" folder to select "WGS_1984_UTM_Zone_10N".
  5. Select "BILINEAR" for the "Resampling Technique" or you will have artifacts in your DEM that will show up when you create direction or hillshade rasters from it.
  6. Leave the remaining default settings as they are and click OK.
  7. The result will not look any different because ArcGIS projects all layers "on the fly" to the spatial reference set in the "Map" properties.

Note: ArcGIS Pro gave me an unknown error when I tried to project the DEM to UTM so I projected it in BlueSpray. QGIS might work as well.

Checking for Artifacts and Creating Hillshades

Before continuing, we want to make sure our DEM does not have any artifacts that could cause problems (this happens a lot with DEMs). A handy tool for this, and making backgrounds on maps is the "Hillshade" tool.

  1. In Geoprocessing, search for "Hillshade".
    1. If you receive an error that you do not have a license for these tools, go to "Project -> Licensing" and click on "Configure your licensing options". Use this dialog to turn on licensing for Spatial Analyist to access the Hillshade and other tools.
  2. Select our clipped and projected DEM for the "input raster"
  3. Give the "Output raster" a good name like "Hillshade.img" and save it in the Arcata Forest working folder.
  4. For now, we'll leave the "Azimuth" and "Altitude" values at the defaults as these are also the default for most western maps.
  5. When you click "OK", you should see a simulation of light reflecting from the topography as if the sun were to the north west. If you see any lines running through the hillshade that should not be there then you have "artifacts" in the image from processing or the original data collection and you'll run into problems down the road.
  6. Hillshades are very commonly used for backgrounds on maps as well. As long as we're here, let's make one.
  7. In ArcGIS Pro,
    1. Right click on your DEM and select "Symbology".
    2. Change the "Color scheme" to something interesting.
    3. Click on the "Appearance" tab and use the slider at the top of the "Effects" box to change the transparency to 50%.
    4. If you do not see a colorized hillshade, make sure the DEM is above the hillshade in the Table of Contents.
  8. Zoom into the hillshade and look for artifacts that might cause problems when making a stream network. You might see what looks like indentations along the ridge lines. What impact might these have?
  9. When you have a chance, come back to these steps and play with the color ramps and other settings to make nice backgrounds for this report and future ones.
  10. Note: Change the "Brightness" in the "Display" tab of both rasters to make the hillshade fade into the background.

Creating a Stream Network

Creating a stream network requires a number of steps but should work out if you are careful (or are ready to go through the process several times).

  1. Load the DEM that is clipped around Arcata Forest from the previous section.
  2. In Geoprocessing, click on the "ToolBoxes" tab and go to: "Spatial Analyst Tools" -> Hydrology". Typically we just search for tools but all the Hydrology tools are in one toolbox so they are easier to access this way.
  3. Before we work with a DEM we have to "Fill" any "Holes" in the DEM. These are pixels that have very low values and will cause a stream to disappear during processing (take a look at your existing streams layers and see if you can find the one that was done with a DEM without the holes filled). Select the "Fill" tool.
  4. Select our clipped and projected DEM for the "Input surface raster"
  5. Name the "Output surface raster" "Filled.img" and save it into the Arcata Forest working folder. When you click OK, you should see a new DEM that looks just like the old one.
  6. The next step is to create a raster that shows the direction that water will flow downhill. Select the "Flow Direction" tool.
  7. Use our filled DEM for the "Input surface raster"
  8. Set the "Output flow direction raster" to "Direction.img" and save it into the Arcata Forest working folder. you should see a very brightly colored image where the pixels have been given "codes" for the cardinal direction (N, NW, W, SW, S, etc.) for the direction that water would flow from this pixel.
  9. We'll now use the Direction raster to create a raster where each pixel represent the number of pixels that "flow" or "accumulate" into it. Select the "Flow Accumulation" tool.
  10. Select the "Direction" raster for the "Input flow direction raster" and give the output raster a name like "Accumulation.img" and save it in the "Arcata Forest" working folder.
  11. After you click "OK", you should see a few lines that are the ends of the streams that appear in the DEM. To see these better:
    1. In ArcGIS Pro:
      1. Right click on the "Accumulcation" layer and select "Symbology"
      2. Make sure the "Primary Symbology" is "Stretched"
      3. I find that the "Stretch Type" of "Histogram Equalization" is the best to see all the accumulation paths.
  12. Do you notice anything strange about the accumulation of water in the raster?
  13. Next, we need to create a raster that contains 1's where we want the steams to be and 0's elsewhere. In Geoprocessing, search for "Raster Calculator". This is a powerful tool that lets you do mathematical and other operations on entire rasters. Double click on the "Accumulation" raster and then type ">100".
  14. Name the output file "Accumulation_GreaterThan_100.img" as on a real project, you would probably try different amounts of accumulation.
  15. When you click "OK", you should see a raster with 1's where the pixels along the streams have "accumulated" the water from over 100 other pixels.
  16. Try one at 1000 pixels and some other values. Note that this tool is handy for making streams at different levels of detail for research and for cartography.
  17. Our last step is to convert these rasters to polylines that represent a stream network. Open the "Search" tool and enter "Raster to Polyline".
  18. Use your Accumulation_GreaterThan_100" raster for the "Input rater" and name the output "Streams_Over_100.shp". Make sure to turn off "Simply polylines"!

Clean up

You may have noticed some little squares where the conversion to polyline followed multiple paths for your streams. These are not desired so we'll need to remove them.

  1. Clip the streams to just the boundary we used for clipping the DEM (i.e. a boundary larger than the forest boundary) and use the new stream shapefile for this section.
  2. Open the attribute table.
  3. Start and edit session.
  4. Zoom in to one of the areas with the extra polylines.
  5. Select some of the extra polylines.
  6. At the bottom of the attribute table window, select the icon to "Show selected records". This will allow you to view just the selected records and you should now see the rows for the features you selected.
  7. Show selected records icon at the bottom of the attribute table window
  8. Right click on one of the rows and select "Delete Selected".
  9. The rows should disappear and the extra polylines with them.
  10. Repeat this process until all the extra polylines within the forest are gone and then, stop the edit session.
  11. You also may have noticed that the stream reaches are broken into far more segments than needed. Run the "Unsplit" tool to join the streams into their correct reaches.

When completed, you should have a stream network that is a visible improvement over some of the other layers and, even more critically, it matches your DEM exactly for future analysis!

Comparing Results

Load your other water body layers into ArcGIS Pro and compare them with your new stream layer. Add a map for this new layer to your report.

Finding the Watershed

Using our direction raster we can create a polygon shapefile that describes the "watersheds" in our area of interest. First, we need to create a point file that contains "pour points". These are the points where the water will "flow" through the streams. ArcGIS uses these as a starting point and will then backtrack using our direction raster until it reaches the ridges that define our watersheds.

  1. Create a point shapefile as we have done before (right click on the folder in ArcCatalog, select "New Shapefile", etc.).
  2. Name the file "PourPoints.shp".
  3. When you create the file, make sure to set the spatial reference to match your existing layers.
  4. When digitizing your points, make sure to zoom in and the tool should "snap" to your polyline for your stream.
  5. Image showing the mouse cursor highlighting when over a point.
  6. Your selection of points is also important. Try to find areas of stream reaches that are away from tributaries and low in the watershed. This will reduce the number of points you need.
  7. Make sure to "Stop Editing" when you feel you have a good set of points.
  8. Before creating the watershed, we need to make sure our points are actually on the accumulation raster pixels that the stream flows through.
  9. Open the "Hydrology" tool-set in Spatial Analyst and select "Snap Pour Point". This feature will create a raster with pixels that are in exactly the location we need.
  10. Select your pour point shape file for the first input.
  11. Select the "FID" as the "Pour point field" so we have a unique value for each pixel in the watershed.
  12. Select the accumulation raster you made above for the "Input accumulation raster".
  13. Give the raster a good name and save it in your working folder.
  14. The "Snap distance" is how far ArcGIS should look for the highest value (our stream course) in map units (i.e. meters). Enter a value that is a few pixels across (if you've forgotten the resolution of our rasters, you can check in "Properties -> Source".
  15. Zoom into one of your pour points and you should see a pixel nearby. Grab the "Info" tool and check that the pixel value matches the FID of the point nearby.
  16. Image of a pixel that has been snapped to the highest value
  17. Finally, select the "Watershed" tool from the ArcToolbox.
  18. Select our direction raster for the first input.
  19. Select the "pour point" raster you just created for the second input.
  20. Give the watershed output a good name and save it in the working folder.
  21. When done, you should see watersheds for Arcata Forest. However, don't be surprised if this does not work the first time. You will probably have to go back to step 7 and add pour points or move them to be on top of the right accumulation pixel to catch all the watersheds.

Warning: Do not create multiple files with pour points and then try to merge them together. The watershed tool relies upon a single set of pour points to accurately determine the watersheds.

Finding the watersheds and stream network in BlueSpray

BlueSpray is availabe on the lab computers or at the BlueSpray website. There are technical difficulties with Java applications on the Cal Poly Humboldt campus and ITS is working on resolving these. In the mean time, they have installed and tested a copy of BlueSpray on the GIS lab computers that should work for the following steps.

This video shows the process of creating watersheds and stream networks in BlueSpray.

Clip the raster to the area of interest

  1. Load the DEM by dragging the DEM file into a view in BlueSpray
  2. Drag and drop the forest boundary shapefile into BlueSpray. BlueSpray will let you know if the data needs to be reprojected and then will reproject it to match the DEM
  3. Use the Marquee tool to select the area to crop. You will want to leave quite a bit of space around the forest to make sure you get all of the watersheds.
  4. Right click on the DEM layer and select ”Transforms General -> Crop Raster”.
  5. Select AOI in the "Set To" popup to set the cropping bounds to the area of interest you defined.
  6. Click OK to crop the raster to the selected area.  This will create a new layer.
  7. Right click on the old DEM and select “Remove”
  8. Right click on the new DEM layer and select “Export to File…” to save a copy of the DEM
  9. Note that BlueSpray keeps everything in memory, not on disk.  This makes processing very fast but dangerous! Remember to save any layers you need.

Projecting the DEM

  1. If the DEM is not in the desired Spatial Reference System (SRS, aka Coordinate System and sometimes incorrectly referred to as a projection).
  2. Right click on the “Scene” and select “Transforms -> Change SRS”.  If this is grayed out, it is because you don't have a defined SRS and you’ll need to “Define” one first.
  3. Select your desired SRS.
  4. BlueSpray will project all the data in the scene to the new SRS.
  5. Save the new DEM if desired.

Checking for Artifacts

  1. Right click on a DEM in BlueSpray and select "Transforms: Cartography -> Carto Mixer". This is a tool that makes it easy to create hillshades (AKA shaded reliefs).
  2. Click on the "Update" button to see an initial, gray-scale, shaded relief.
  3. Click in the "Color Ramp" popup and select a more colorful ramp and then select "Update". A more colorful ramp will make it easier to see artifacts.
  4. When you have a color ramp you like, click "OK".
  5. Zoom into the image and see if you can find any systematic patterns in the DEM. This is a major problem because the water will flow along the patterns rather than follow the true water course.
  6. The Carto Mixer creates RGB rasters that can be saved as TIFF files and then loaded into your favorite cartography package as backgrounds.

Finding the initial Direction Raster

  1. Right click on the DEM (not the hillshade) and select “Transforms: Water -> 2. Find Flow Direction”.
  2. Make sure the DEM is selected as the first input and click OK. The resulting Flow Direction layer will be displayed with arrows to show the direction of flow.  Circles are used for one pixel sinks.  Squares represent two or more pixels that have the same value and are thus “flat”.

Making all the pixels flow to a pour point

The steps below will create a direction layer that does not have any flat areas and only has sinks on the edge of the raster. Follow the steps carefully and make sure the right layers are specified in each of the transforms or things can go wrong!

  1. Finding the Pour Points
    1. Right click on the Original DEM and select “Transforms: Water -> 3. Find Pour Points”.
    2. Click OK. This may take a few minutes for large rasters.
    3. The resulting Pour point layer may contain a large number of pour points.  This is because all the little watersheds at the edge of the raster each get a pour point. You actually want all these because it keeps the water on the edges flowing off the raster instead of into your watershed.
  2. Finding the initial watershed raster
    1. Right click on the Pour Point raster and select “Transforms: Water -> 4. Find initial watershed raster”.
    2. Make sure you have the correct pour point and direction raster selected and click “OK”. This transform will flow all the pixels in the specified direction raster into the provided pour points.  Each pixel that is found to be in a watershed will be given a value that is greater than 0 to identify the watershed it is in. Pixels that do not make it to a pour point, will appear with a value of 0.  For most DEMs, the large majority of the pixels will not flow to a pour point. The next steps will address this.
  3. Finding the rest of the watershed
    1. Right click on the watershed raster and select “Transforms: Water -> 5. Add Pixels to Watershed Raster”. 
    2. Use the watershed raster that was created above and the same direction and elevation raster and click “OK”.  This transform will then add the pixels with a value of 0 to a watershed raster. This is done by “filling” sinks and flowing “flat areas” into the appropriate watershed. This will produce a new direction raster with all pixels flowing to a pour point.
    3. Note that this is one of the few BlueSpray transforms that modifies an existing raster rather than create a new one. 

Find the accumulation raster

This step will create an accumulation raster where each pixel is a count of the number of pixels that flow into it.

  1. Right click on the "Flowing Direction Raster" and select “Transforms: Water -> 6. Find accumulation”.
  2. Accumulation rasters contain very large numbers at the end of their paths so the accumulation layer is given a special color ramp that compensates for this.

Find the stream network

Next, we will use the accumulation raster to create a stream network.

  1. Right click on the accumulation raster and select “Transforms: Water -> 7. Find stream network”.
  2. Select the "Flowing Direction Raster" for the “Directions”. The “Minimum Accumulation” sets the value that is required in an accumulation pixel before a stream is started.  Setting it to 0 will include all pixels in the accumulation raster in the stream network and make it overly complex.  If unsure, leave at the default of 100. Higher values will reduce the complexity of the stream network but may not reflect reality.
  3. When you click “OK” BlueSpray will create a vector layer that includes each of the stream reaches as a feature.
  4. Now is a good time to turn off the accumulation layer and the direction layer and see if the streams are flowing as expected and are within the watersheds.
  5. Note that the watersheds may not match what you expect and will not typically match Hydrologic Units (aka HUCs) that are party of the National Hydrology Dataset.  This is because these watersheds represent an entire watershed from where your pour points were defined.
  6. If you plan to do stream work in the future, take a look at the attributes for the stream layer and you'll see that they include the stream order, an index to the stream reach that is below each stream (-1 for none) and the number of pixels that accumulated into each reach.

Finding the final watersheds

  1. Create the pour points for the desired watersheds
    1. Right click on the “Scene”, Select New Layer, and select “Point Layer...” leave all default settings and click OK to add a new point layer to BlueSpray.
    2. Right click on the eyeball or arrow cursor icon next to the new layer’s name and select “Editable”.  A pencil icon will appear. This will allow you to edit the layer.
    3. Make sure the pencil is selected in the drop down box in the toolbar.
    4. Move the Flow Accumulation layer so it is just below the new point layer.
    5. Zoom into where the pour point should be and the accumulation pixels are rather large. Make sure you zoom in fairly far down the stream network from Arcata Forest to make sure you have a watershed that is large enough.
    6. Click in the desired accumulation pixel to add the pour point.  The pour point needs to be toward the center of the desired pixel on the accumulation path (i.e. stream path).
  2. Create the new watersheds
    1. Right click on the Newly Created Pour Point layer and select “Transforms: Water -> 4. Find initial watershed raster”
    2. Make sure the "Flowing Direction Raster" is selected for the direction input layer.
    3. When done, you should have watersheds that have all the streams flowing through the selected pour point pixels in the accumulation raster. 
  3. Convert watersheds to polygons
    1. BlueSpray has a new feature to convert rasters to watersheds.
    2. Right click on your watershed layer and select "Transforms -> To Polygon". This transform should convert each watershed to a polygon. If it does not, please convert the rasters to polygons in ArcGIS as in the section below.

Saving your results

Before you close BlueSpray, be sure to save your results. I recommend saving at least the clipped DEM, the stream layer, the direction raster, and the watershed raster.

  1. Right click on each of the layers you want to save and select Export To File....
  2. Save your point, polyline, and polygon layers as shapefiles (.shp) and your rasters as TIFF (.tif) files.

You may need to repeat the steps above a few times to get exactly the watersheds you want within Arcata Forest.

Converting Watershed Rasters to Polygons in ArcGIS

Arcata Forest drains into two main watersheds, the Mad River and Arcata Bay! Depending on the pour points you selected, you may see many more "watersheds" or fewer depending on where you placed your pour points.

Map of the watersheds

The last step is to convert this into a polygon shapefile which will be much easier to work with and will be easier on the eyes!

  1. In the search box, enter "Raster to polygon".
  2. At this point, we're going to be giving you fewer instructions in the labs as you're beginning to master running ArcGIS. For this tool, just make sure to uncheck the "Simplify polygons" option as we want our polygon and exactly match our raster and we can always simplify it later if desired.

For your report, include a map of the watersheds, pour points, and streams. Use a nice hillshade but make sure to make the contract low or make it relatively transparent so it does not interfere with your key message. The one below is just to give an idea of the final map. Yours should include the required elements, labels, and look nicer!

Final map of the watersheds, streams, and pour points

 

Computing geometries

For our report, we need to include the number of streams, their length, and the number of watersheds, and their area. For the report, we'll be using the streams that drain at least 100 pixels (include the area of these watersheds in your report). To compute the length of the streams, add a "Length" field to the attribute table and then use "Calculate Geometry" to compute the length of each stream. Then, you can export the table to a CSV file and compute the total length of streams in MS-Excel.

Other Resources

Esri Help

© Copyright 2018 HSU - All rights reserved.