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. In ArcGIS:

  1. From the "Geoprocessing" menu, select "Clip"
  2. For the "Input Features" use the "CA_Wetlands" shapefile (depending on the downloaded file, it may be "CA_Wetlands_North").
  3. For the "Clip Features" use the Humboldt County Boundary.
  4. Set the "Output Feature Class" to "Humboldt_WetLands.shp" and save it in the "Humboldt_County" "Working" folder.
  5. When you click "OK", ArcMap 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.Clipping settings dialog

 

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. Launch ArcMap and open a blank map document (.mxd).
  5. Navigate to "Data Management Tools -> Projections and Transformations", 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:
    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 select "File -> New" in ArcMap 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 ArcMap, 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

Clipping a DEM in ArcGIS

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

  1. If the "Draw" tool bar is not visible, right click in the blank area of the menu bar in the top-right area of ArcMap and select "Draw".
  2. Draw a "box" around Arcata Forest with plenty of room on the sides. The box should be about four times as large as the forest.
  3. In the "Draw" toolbar, select "Convert Graphics To Features" in the "Drawing" menu. This feature allows us to convert a drawn element into a feature in a shapefile which is really handy.
  4. Set the "Output shapefile" to be a file called "ClippingBoundary.shp" and store it in your "Arcata Forest" folder in your working folder.
  5. When you click "OK" you'll see the boundary added as a layer.
  6. Click on the original box you drew and then click the "Delete" key on the keyboard. This will delete the box you draw but the feature in the shapefile should still be visible.
  7. Clipping rasters is different from clipping vectors so open the search box and type in "Clip Raster"
  8. The first item should be "Clip" in "Data Management". Select this tool.
  9. Select the DEM from last week that overlaps with Arcata Forest as the "Input Raster" and the "ClippingBoundary" as the "Output Extent". Then, set the "Output Raster" to "DEM_Clipped.img" in your Arcata Forest working folder.
  10. The clipped DEM should appear around your Arcata Forest boundary.

Walk Through: Projecting Raster Data in ArcGIS

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

  1. Navigate to "Data Management Tools", "Projections and Transformations","Raster", and select the "Project Raster" tool.
  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.

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 the ArcToolbox, navigate to "Spatial Analyst -> Surface -> Hillshade". If you receive an error that you do not have a license for these tools, go to "Customize -> Extensions" and select "Spatial Analyst".
  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 on.
  7. Right click on your DEM and select "Properties".
  8. Select the "Symbology" tab and change the "Color Ramp" to something more interesting.
  9. Right click on your Hillshade layer and set the "Transparency" to 50%.
  10. 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.
  11. 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. Open the "ArcToolbox" and "Spatial Analyst Tools" -> Hydrology". If you receive an error that you do not have a license for these tools, go to "Customize -> Extensions" and select "Spatial Analyst".
  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, right click on the "Accumulation" layer and select "Properties".
  12. Click on the "Symbology" tab and make sure "Show" is set to "Stretched".
  13. Change the "Color Ramp" to something more interesting and set the "Type" to "Standard Deviations". This should make it easier to see the streams.
  14. Next, we need to create a raster that contains 1's where we want the steams to be and 0's elsewhere. In the ArcToolbox, navigate to "Spatial Analyst -> Map Algebra" and open the "Raster Calculator". This is a powerful tool that lets you do mathematical and other operations on entire rasters. Double click no the "Accumulation" raster and then type ">100".
  15. Name the output file "Accumulation_GreaterThan_100.img".
  16. Raster calculator setup to computer accumlation greather than 100
  17. 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.
  18. 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.
  19. Our last step is to convert these rasters to polylines that represent a stream network. Open the "Search" tool and enter "Raster to Polyline".
  20. 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 ArcMap 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. A short cut is to "Import" the spatial reference from one of your existing files.
  4. Dialog showing the import option for specifiing an SRS
  5. When digitizing your points, make sure to zoom in and the tool should "snap" to your polyline for your stream.
  6. Image showing the mouse cursor highlighting when over a point.
  7. 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.
  8. Make sure to "Stop Editing" when you feel you have a good set of points.
  9. Before creating the watershed, we need to make sure our points are actually on the accumulation raster pixels that the stream flows through.
  10. 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.
  11. Select your pour point shape file for the first input.
  12. Select the "FID" as the "Pour point field" so we have a unique value for each pixel in the watershed.
  13. Select the accumulation raster you made above for the "Input accumulation raster".
  14. Give the raster a good name and save it in your working folder.
  15. 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".
  16. 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.
  17. Image of a pixel that has been snapped to the highest value
  18. Finally, select the "Watershed" tool from the ArcToolbox.
  19. Select our direction raster for the first input.
  20. Select the "pour point" raster you just created for the second input.
  21. Give the watershed output a good name and save it in the working folder.
  22. 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.

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. Click OK to crop the raster to the selected area.  This will create a new layer.
  6. Right click on the old DEM and select “Remove”
  7. Right click on the new DEM layer and select “Export to File…” to save a copy of the DEM
  8. 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 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 New 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 new 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 HUCs 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/Black 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 new 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. 

Saving your results

Before you close BlueSpray, besure 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).

  1. Open the attribute table (right click on the layer and select "Open Attribute Table".
  2. Click on the little arrow in the upper left of the attribute table and select "Add Field".
  3. Adding a field to an attribute table
  4. Name the field "Length". Note that the names of fields in ArcGIS are only allowed to be 10 characters long.
  5. Set the "Type" to "Double".
  6. Don't worry about the "Field Properties" now or even in the future. I never change these.
  7. When you click "OK" the new field should appear.
  8. Right click on the field heading and select "Calculate Geometry...". This will open a tool you can use to compute the length of polylines, the area of polygons, and to get the coordinate values for points.
  9. Selecting the geometry calculator tool
  10. You may get an error at this point that you are outside an editing session. That is OK and just keep going.
  11. Compute the "Length" of the streams

Other Resources

Esri Help

© Copyright 2018 HSU - All rights reserved.