Stream Network and Watershed Delineation Using Spatial Analyst Hydrology Tools
Stream Network and Watershed Delineation Using Spatial Analyst Hydrology Tools
Prepared by
Venkatesh Merwade
School of Civil Engineering, Purdue University
[email protected]
January 2019
Objective
The purpose of this exercise to learn how to delineate stream network and watersheds
from a digital elevation model (DEM) using the Spatial Analyst Hydrology Tools in
ArcGIS.
Learning Outcomes
Input Data
Input Data needed for this exercise is provided in lab3.zip folder on Blackboard. The
data are also available at: ftp://ftp.ecn.purdue.edu/vmerwade/download/data/lab3.zip.
Copy the file on your working drive/folder, and unzip it. The ArcCatalog view of the data
folder is shown below:
Note: It is very critical to assign and use consistent coordinate system for all the datasets
used in delineating watersheds by using any pre-processing tool.
Getting Started
1
Open ArcMap and save it as lab3.mxd. All spatial analyst tools that are used for
delineating stream network and watershed boundaries are available in ArcToolbox. If
ArcToolbox is not activated within the map document, click on the ArcToolbox button
to access the tools. Hydrology tools can be found by selecting Spatial Analyst
ToolsHydrology within ArcToolbox as shown below:
Now add cedar_dem to the map document. This is the only dataset you will need to get
started with the process. Note the lowest and highest elevation in this dataset. Open the
properties of this dataset to look at the cell size, projection and the pixel type. We will
add other datasets later in the tutorial. Before using any tool in ArcToolbox, go ahead and
disable the background processing by going to GeoprocessingGeoprocessing options..
Filling Sinks
The Fill function fills the sinks in a grid. If cells with higher elevation surround any cell
in a DEM, the flow gets trapped in that cell and cannot go downstream. The Fill function
modifies the elevation values to eliminate this problem.
Double click on the Fill tool. Provide cedar_dem as the input surface raster, and save the
output raster as cedar_fill in your working directory. The main function of this tool is to
remove imperfections in the DEM to enable the flow move downstream. However, if
there are natural sinks in the data (e.g, 10m deep lake), you can use the “Z limit” to retain
these natural sinks. For example, if you specify Z limit as 6m, the program will not fill
any sinks that are deeper than 6m. The default is to fill all sinks (do not provide any input
for Z limit). Click OK.
2
After the process is complete a filled DEM (cedar_fill) will be added to the map
document. Again, note the highest and lowest elevation in this dataset.
Q1. How has the high/low values of the filled DEM changed? Why?
Flow Direction
This function computes the flow direction for a given grid. The value in any given cell of
the flow direction grid indicates the direction of the steepest descent from that cell to one
of its neighboring cells using the eight direction pour point (D8) method. In the D8
method, the steepest descent for each cell is computed by looking at the slope between
the target cell and its 9 neighbors. A flow direction number is given to each cell
depending on the location of the neighboring cell that produces the steepest slope as
shown below. For example, if the steepest slope from the central cell is towards south, the
central cell will get a value of 4.
Double click on Flow Direction tool. Select cedar_fill as the input surface raster, and
name the output raster as cedar_fdr. The optional output drop raster will produce a raster
that shows the ratio in percent between the maximum drop in the elevation from each cell
towards the direction of the flow and the flow length between the adjacent cells. We do
not need the drop raster so leave this input empty. The other option of forcing all the edge
cells to flow outward is also not needed for this exercise so leave that option unchecked.
Click OK.
3
After the process is complete, a flow direction grid with cells having one of the eight
flow direction values (1,2,4,8,16,32,64,128) will be added to the map document. Save the
map document. Look at the properties of cedar_fdr.
Q2. What is the pixel type for the flow direction raster? Why?
Flow Accumulation
The Flow Accumulation function uses the flow direction grid to compute the
accumulated number of cells that are draining to any particular cell in the DEM. Double
click on Flow Accumulation tool. Select cedar_fdr as the input flow direction raster, and
save the output flow accumulation raster as cedar_fac. Leave the default options for input
weight raster as null, and change the output data type to INTEGER. Click OK.
After the process is complete, a flow accumulation grid will be added to the map
document. You will clearly see a stream network in this output, and if you check the pixel
value (by using the identifier tool), the values along the cells that appear to form a stream
4
network will have much higher values compared to the surrounding cells. If you do not
see the network clearly, zoom-in until you see the network. Save the map document.
Right click on cedar_fac layer, and see if you can open the attribute table. If you are not
able to see the attribute table, then we need to build one. To build an attribute table for an
integer raster, you can use the ArcToolbox. Click on Data Management
ToolsRasterRaster PropertiesBuild Raster Attribute Table. While building the
table, leave the option overwrite box unchecked, and click OK. Once this is done, you
will now be able to see the attribute table.
Q4. What information is contained in a raster attribute table? How is this table different
than the attribute tables for vector features (points, lines and polygons)? (Hint: think of
the mandatory fields, what information is stored in raster attribute table)
Stream Network
Because the flow accumulation gives the number of cells (or area) that drain to a
particular cell, it can be used to define a stream. It is assumed that a stream is formed
when a certain area (threshold) drains to a point. This threshold can be defined by using
the number of cells in the flow accumulation grid. If we assume an area of 25 km2 as the
threshold to create a stream, the number of cells corresponding to this threshold area is
27,778 (25000000/(30*30)). To create a raster, that will have stream cells corresponding
to a threshold area of 25km2, select Spatial Analyst ToolsConditionalSet Null.
Create a raster from cedar_fac such that it only includes cells that have pixel value
greater than 27778 as shown below. This will create a calculation raster where all the
cells with value greater than or equal to 27778 in cedar_fac will have a value of 1, and all
other cells are set to Null. Save the output raster as stream in your working directory.
Click OK.
Q5. What will be the equivalent threshold area in km2 if you want to use 50,000 cells?
5
(Note: This step can also be accomplished using the Con tool under Spatial Analyst
ToolsConditional)
Stream Link
This tool assigns a unique number to each link (or segement) in the stream raster. Double
click on Stream Link. Provide stream as the input stream raster, cedar_fdr as the flow
direction raster, and name the output raster as str_link.
Basin
This tool uses the flow direction grid to find all sets of connected cells that belong to the
same drainage basin, and assigns a unique number to all the cells within that basin.
Double click on Basin. Provide cedar_fdr as the input flow direction raster, and name the
output raster as cedar_basin as shown below. Click OK.
After the process is complete, cedar_basin raster will be added to the map document.
Change the symbology of this layer to a different color ramp to see each basin distinctly.
Although you will see a big drainage basin that gives the drainage boundary for cedar
creek output, there are some small drainage areas that do not drain to the cedar outlet.
6
We can use the basins raster to get polygons as boundaries for all the basins. Select
Conversion ToolsFrom RasterRaster to polygon. Provide cedar_basin as the input
raster, choose output geometry type as polygon, and save the output as
cedar_boundary.shp in your working directory as shown below. Click OK.
After the process is complete, cedar_boundary shapefile will be added to the map
document. This shapefile will contain multiple polygons, with each polygon representing
a watershed that is draining to an outlet.
Q6. What is the area (in square kilometers) of the biggest basin among all the basin
polygons in the dataset? (Hint: explore the measure tool in ArcMap, also learn how to
calculate geometry (length or area) for a field in attribute table)
Stream Order
This tool creates stream order for the stream network. Double click on stream order.
Provide stream as the input for stream raster, cedar_fdr as the input for flow direction
raster and name the output raster as str_order as shown below. Two methods are
available for estimating stream order. Choose anyone you like (Strahler in this case), and
click OK.
7
After the process is complete, str_order will be added to the map document.
Q7. What is the stream order of the biggest watershed in the dataset?
Stream to Feature
This tool converts stream raster to a polyline feature class or shapefile. Provide stream as
the input for stream raster, cedar_fdr as input for the flow direction raster and save the
output as stream.shp in your working directory. Click OK.
After the process is complete, a shapefile named stream will be added to the map
document. Save the map document. You can use this tool to create features from other
stream related rasters such as stream order and stream link.
Q8 How many streamline features are created? How did you find out?
Q9. What is the total length of all streams? How did you find out?
Flow Length
This tool uses the flow direction to compute the flow distance or length from each cell to
the most downstream or upstream cell in the DEM. Double click on Flow Length.
Provide cedar_fdr as the input flow direction raster and save the output as cedar_len in
your working directory as show below. Use downstream to compute the flow length to
the watershed outlet. Click OK.
8
After the process is complete, cedar_len will be added to the map document.
Q10. What is the maximum distance any water drop will travel in the given dataset?
If you have not done already, add the point shapefile from your working directory to the
map document. The DEM that you have used contains the cedar creek watershed and
surrounding areas. In order to delineate the cedar creek watershed, add the point shapefile
in your map document. Watersheds are delineated by defining a point on a stream so it is
important that the points you use to delineate a watershed must intersect with the stream
line. Now zoom to each point to see if they fall on the stream cell. If not, find out how far
each point is from its stream. You will see that one point is closer to the stream and other
point is little too far off. We will create a new dataset and pull these points to align with
the stream by using the Snap Pour Point tool. Double click on Snap Pour Point. Use the
point shapefile as input for the feature pour point data, leave the default Id field
unchanged for pour point field (although this field is optional, it is important to specify
this field and make sure that each point has a unique ID), use cedar_fac as input for the
flow accumulation raster and name the output raster as snap_pt. Use a snap distance of
200m (this may change for different datasets and resolutions). This distance is decided
based on how far your points are from the stream. Click on the Environments, and make
sure that the extent (under processing extent) is set to cedar_dem, and the mask under
raster analysis is also set to cedar_dem). Click OK.
9
After the process is complete, a raster named snap_pt will be added to the map document.
Zoom-in to the points to make sure that they align with the stream or flow accumulation
grid.
Next, double click on Watershed. Use cedar_fdr as input for flow direction, snap_pt for
input pour point raster, leave the default pour point field unchanged, and name the output
raster as watershed. Click OK.
After the process is successfully completed, you should get a raster showing watersheds
at these two points as shown below. If for some reason, you do not see any delineation or
if the watershed size is too small, run the tool again, but make sure you set the processing
extent correctly by going to EnvironmentsProcessing Extent in the tool options.
10
OK, you are done using all spatial analyst tools for hydrology in ArcMap!
Q11. Add two more points to the point feature class (shown by arrows below, you can
add these points at approximate locations along the stream lines shown below), and
recreate sub-watersheds using the Watershed tool. What is the area of these four sub-
watersheds in km2? (Note: Think about the role of Id field you used earlier before
running the watershed tool).
11
Q12. How many rasters and vector datasets did you create until now? How are these files
stored in your working folder? How is the format of the vector files different than the
vector data you created in lab1 for storing gauge points and time series? What is the
format of the raster outputs?
Q13. You learned the use of all spatial analyst hydrology tools in ArcGIS. If you are
given a DEM and a point, do you have to use all these tools or can you get delineate the
watershed for the given point by using only a few tools? Write the names of the tools in
the sequence that you will use in delineating the watershed. Draw the sequence/flow chart
to show the input(s) and output(s) for each tool.
12
Creating a Model Builder Application
In order to create a model builder application, first create an empty toolbox by right-
clicking in the “white” space in ArcToolbox, and selecting Add Toolbox as shown below
as shown below:
In the Add Toolbox window, press the tool box button on the top-right corner ( ) to
create a new toolbox with the name Watershed Delineation as shown below. Click OK.
In ArcToolbox, right-click again on the white space to add the new Watershed
Delineation toolbox.
Right-click on Watershed Delineation toolbox, and create a new Model as shown below.
13
This will open the Model Builder interface in which you can create a workflow model by
dragging tools from the ArcToolbox. Save the Model. Lets create a model that uses the
filled DEM to create a flow direction raster.
Drag the Flow Direction tool from ArcToobox in the Model interface to see the tool in
the Model Builder interface as shown below.
A rectangle (with the hammer) represents a tool, and an oval represents an input/output
file. White colored box means that no input is provided to the tool. Double click on the
Flow Direction rectangle to select cedar_fill as the input surface raster. Name the output
flow direction raster as cedar_fdr2 (we already have cedar_fdr), and click OK (no need to
specify the optional drop raster).
As soon as the input is provided, all the boxes (except the optional output drop) will
change their color as shown below.
14
A toolbox is always yellow, a blue oval represents input to the model, and a green oval
represents the output from the tool or the model. If you want, you can change these colors
by right-clicking on them and selecting Display Properties. Similarly, you can make the
model to add the final output or any intermediate outputs to the map document by right-
clicking on the oval, and selecting Add to Display as shown below.
Save the model. You can expand the model to perform flow accumulation, and also the
subsequent steps by dragging the tools from the ArcToolbox, and providing appropriate
inputs. A workflow to start with DEM and get the stream network is shown below.
You can run the model by either pushing the run button or going to ModelRun
Entire Model. Ok, you are done!!
15
Homework #3 (Due on 01/29 by 5 pm in HAMP 1101G)
Answers all the questions (Q1 – 13) included in the handout. For Q13, create a nice
presentation quality map for Cedar Creek to show all the points and their boundaries
using distinct color/shade.
Create a model builder application to start from a DEM of Cedar Creek and end with
a stream network (as a shapefile not raster). Use this model builder application to
create stream network for Cedar creek by using the following threshold areas as a
percentage of the total watershed area: 1%, 2%, 3%, 5%, 7.5% and 10%.
Create a map of each stream network with proper legend and scale. Report the
drainage density [in km-1] corresponding to each stream network threshold. The
equation for computing drainage density = total length of all the streams in a
watershed / total area of the watershed. The unit for drainage density is [L-1]
16