An ArcView 3 Based Watershed Delineation Application


This Application is Being Developed by Environmental Systems Research Institute (ESRI, Inc.) for the Texas Natural Resource Conservation Commission (TNRCC)

This Document Is Intended to be a Tutorial on How to Use this Application

The Application Developers are Zichuan Ye and Dean Djokic of ESRI

the Tutorial was Prepared by
Seann M. Reed
of the Center for Research in Water Resources
University of Texas at Austin

Last Modfied: 5/27/97

Table of Contents


After a brief description of the purpose and design of this application, this tutorial will be divided into two parts. The first part is designed to make the user familiar with the capabilities of the application using pre-processed data that is provided. The second part is a description of how to pre-process data so that you can use the application at the location of your choice. The only input data requirement for using the application is a digital elevation model (DEM). The data that you will use in the part 1 of the tutorial are all products that can be derived from the DEM during the pre-processing steps.

This application provides interactive tools for delineating areas draining to points, areas draining to stream line segments, and areas draining to and from polygon features. The application uses functionality provided by the ArcView Spatial Analyst Extension and therefore this extension is required to use the application. The application includes a customized GUI which adds to but does not modify the standard ArcView GUI and functionality. In addition to watershed delineation tools, the application also includes utilities for managing point, line, and polygon shapefiles, and pre-processing tools for setting up input data.

Preprocessing functionality for creating a watershed base map is included in this application. The idea is to work from a base-map of standard drainage units and stream reaches. This is similar in concept to using the USGS Hydrologic Cataloging Units (HUCs) and EPA's River Reach Files (RF1), but the base maps that are created for this application have the advantage that the drainage boundaries are consistent with the digital elevation model (DEM). In addition to providing a reference frame, a significant advantage of working with a preprocessed set of subwatersheds in a particular basin is improved delineation speed. Speed is improved because only DEM cells that are contained in the subwatershed containing a selected delineation point need to be processed, even if the selected pour-point is on the main river and many subwatersheds are upstream of this point.

Computer and Data Requirements

The Watershed Delineation Application requires ArcView 3.0 with the Spatial Analyst extension. The application can run on PC's or Workstations. The final version of this product will be completely self-contained but as of 5/2/97, Arc/Info Version 7.0 with Grid is required for pre-processing.

Digital elevation data required to run this tutorial are provided for you. To obtain the DEM data for other parts of the country, see Obtaining Digital Elevation Data from the Internet.


Since the files that you need for this exercise are being transferred from a CD-ROM, all of the source files and directories are "read-only" and some write permissions are required to run the programs.

For PC Users, copy files from the CD-ROM using the DOS XCOPY command so that the files that you copy will no longer be "read-only." (If you use the File Manager to copy files, the "read-only" property will be maintained and you would have to change the properties of each individual file manually using the File / Properties option from the File Manager). Here are the steps you should use to copy data from the CD:

The "/E" is an argument specifying that all subdirectories should be copied.

In a UNIX system, it is easy to recursively change the properties files after they have already been copied from the CD-ROM. The "chmod" command is used to modify file permissions. The following command will recursively add write permission for the user to all files in the directory "tnrcc" (including subdirectories). First move to the directory above tnrcc and then type (the % symbol represents the UNIX prompt):

% chmod -R u+w tnrcc

Additional Notes: These instructions assume a basic knowledge of ArcView. For example, you should know what a Theme, View, Table, Chart, Project, etc. are. You should also know how to doe a few simple tasks like adding Themes to a View and Zooming in and out from a View. The methods for many other tasks will be explained.

Watershed Delineation in The Sabine River Basin

Start ArcView and open the project file called "tnrcc.apr" which is located in the tnrcc directory. There are two Views in this project. One of them is called "For DemPre-Pro" and the other is called "TNRCC-Sabine." You will be working from the View "TNRCC-Sabine" in this exercise. Open this View if it is not already the active window. Note the additions to the standard ArcView View GUI that are included in this application. There is an additional menu called "Hydro," three additional buttons, and four additional tools (some of which are pull-down tools) as indicated in the image below. There may be some additional "extra" menu, button, or tool items in the beta version but the final GUI will look like that shown below. The Spatial Analyst Extension is automatically loaded by this project. The menu item that you see called "Analysis" is part of the Spatial Analyst Extension.

To get started, you need to load some Themes into the View "TNRCC-Sabine." Five products of the pre-processing steps described in the next section are available to you. These five Themes were all created from the digital elevation model. Add the following Themes to the View "TNRCC-Sabine."

From the directory ~/tnrcc/prepdata on your local hard drive, add the Feature Data Sources:

From the directory ~/tnrcc/demdata, add the Grid Data Sources:

Place a check next to Sabstr45.shp and sabply45 to see the shape of the basin that you will be working with. You may want to modify the legends for some of the Themes at this point. The Sabine river basin is located in East Texas and drains approximately 23,900 km2.

The DEM cells that were used to delineate this basin are 80 m cells. Therefore, the flowdirection grid (sabfdr) in the View "TNRCC-Sabine" contains about 3.7 million values.

1. Delineating a watershed from a point

a. Interactive selection with the mouse

To delineate a watershed from a point, you will be using a pull-down Tool menu that looks like this . In a pull-down Tool menu, either of the two Tools may show up at the top. If the red flag is on top, this is what you will see in the Toolbar. Click the left mouse button and hold it on the red flag to see both options. Select to delineate a watershed from a point. (WARNING! The first time through this procedure you will have to answer many questions to get things set up, but you won't need to answer many questions for subsequent delineations). You will be prompted with the following message box:

{Note: The current snapping tolerance for the program is 4 grid cells. If you click a point that is further than 4 cells from a stream (as defined by "sabstr45.shp"), then you may get a very small watershed. If this happens, you may want to zoom in closer before selecting your delineation point. If you zoom in close enough and display the gridded streams (sabstr), then you can see the actual cell which you are selecting.}

Choose "Yes" to snap to a river section and the mouse pointer will become a set of cross-hairs. Click on any location in the stream network of sabstr45.shp to delineate a watershed. At this point, the program checks to see if the required input Themes are available. If you have just added new Themes into your View and/or this is your first delineation, the program needs to know the identity of the input Themes. If the program does not know the identify a Theme that it needs, a menu of choices will pop-up for the user to identify the appropriate Themes. Since this is your first delineation in this Project, you will now be required to identify, the input Themes. You will see a series of message boxes that ask you to identify the RIVER Theme, the WATERSHED Theme, the FLOWDIRECTION GTheme, and the STREAM Gtheme. These message boxes, with the appropriate Theme name selected are shown below. You will also be asked to confirm your choice between each of the message boxes shown below.

WARNING! if you are using a PC you might get a message saying that the point you have selected is not in sabply45.shp, if so, just click OK and select the same point again with the mouse cross-hairs. Now the program will work. This is caused by a program bug. If you do not get this message, it is possible that the very first pour-point that you select will be located incorrectly; however, subsequent delineations will be O.K.

You will now be asked to confirm the selected point. Click "Yes."

If you have selected a point that is not in a headwater basin, then you will need to identify the PREMERGED watershed Theme (mgsab45.shp) as indicated below.

After delineation is complete, you will be asked whether you want to save the results to shapefiles named "PourPnt.Shp" and "PourWsh.Shp." These are the default names of shapefiles to which the selected pour-points and delineated watersheds are saved. You do not have to use these default names but just say "Yes" for now.

These Shapefiles do not currently exist in your project so you will be asked to identify them. Since they do not exist, select "CANCEL" and the program will create these shape files for you.

After selecting "CANCEL," click "YES" at the next message box to create PourPnt.shp.

Select "CANCEL" and "YES" when asked about "PourWsh.shp" as well.

You will now be prompted with a menu that allows you to specify an ID and a name for your delineated watershed. If you stick with the default "Point-ID" suggested by the program, then each watershed that you delineate will have a unique ID.

Click O.K. and you will see your resulting watershed which is one polygon feature in the Theme "pourwsh.shp."

Click the cross-hairs on another point in the stream network. This time you won't have to go through all the message boxes described above. If you have not done so, try delineating a watershed from a point on the main river network that is not in a headwater basin. In this case, the portion of the local subwatershed draining to your selected point is determined and this area is merged with any additional upstream area defined by mgsab45.shp. You be prompted to identify this Theme as the pre-merged watershed if you have not already done so.

Before proceeding to the next section, you may want to delete the watersheds that have been delineated to this point. To do this, make Pourwsh.shp the active Theme and select Theme / Start Editing. Then use to select all of your delineated watersheds and select Edit / Delete Features. You may want to zoom out to see if you have deleted all your delineated watersheds. Another way to check is to look at the attribute table of Pourwsh.shp using , which should have zero records. Repeat this procedure to delete all of the pour points in the Theme Pourpnt.shp. You can save these edits. After you are done editing Pourpnt.shp, select Theme / Stop Editing and then select "Yes" to save your edits.

Delineating a watershed that is smaller than your base stream threshold

It may be that you wish to delineate a watershed which has a smaller drainage area than the threshold of the streams in your basemap. To do this, you need to have some way to identify the location of the streams defined by a smaller drainage threshold. There are two ways that this can be done.

First, try using the Tool from the pull-down menu . This is a tool that traces the path of a drop of water from a point clicked on by the mouse to a watershed outlet. Just click on and then click on any location in the "TNRCC-Sabine" View. Now it is easy to identify cells which are on major drainage paths and watersheds can be delineated from these paths using the Tool. Before using this Tool, it may be helpful to zoom in much closer to the drainage path that you identified with so that you are sure to select a cell that is on the path you just traced out. The snap to stream option is not applicable with this approach. The image below shows how and were used to delineate a watershed with drainage threshold less than 50,000.

The tracing Tool creates graphic objects. These can be deleted from your View by selecting the menu item Edit / Select All Graphics and then Edit / Delete Graphics.

At this point it may be useful to delete all of the watersheds in Pourwsh.shp and all of the points in Pourpnt.shp, again, as described above.

b. Delineation from a point file

A previously prepared set of points can be loaded and used to delineate watersheds. To demonstrate this, add the Feature Data Source ~/tnrcc/usrdata/mypoints.shp to the View TNRCC-Sabine from your local hard drive. Place a check next to mypoints.shp to make these points are visible. These points are all located in the upper portion of the Sabine Basin. Pan or Zoom (in or out) to locate these points if necessary. Now click on and you will be given a message box allowing you to specify the names of the input point file and the output watershed shapefile. Fill in this menu as shown below and click OK.

Click "YES" to create the shapefile "MyWsh.shp" which does not currently exist.

Delineating the drainage areas to the three points in MyPoints.shp may take a few minutes. Messages will appear at the bottom of the Arcview window indicating the status of calculations. When the calculations are complete, place a check in the box next to the Theme "Mywsh.shp" to see the results. You should see something like this:

Looking at the results, you can see that one of the points (#2 in the map above) is not on a major drainage pathway. What actually occurred is that a very small watershed with only a few cells was delineated. The problem was that this particular point is too far from the stream for the snapping procedure to work. To fix this problem, let's replace point #2 with a new point and then delete the old point using the following steps: (1) Zoom in on pour point #2 using . (2) Create a new point that is on the stream by clicking on the red flag (which can be found in the pulldown Tool menu with ), typing Mypoints.shp and Mywsh.shp as the point and watershed Themes respectively, choosing No=Append to Pourpnt.shp and No=Append to MyWsh.shp, and finally clicking somewhere on the stream for the new point. You will now be given the opportunity to identify your point.

Click OK. The value of 1 next to "Snap2River" indicates that you want this point to be snapped to the river. (3) To delete the old point, make sure that MyPoints.shp is the active Theme and select Theme / Start Editing. Select the old point point #2 using and choose Edit / Delete Features. (4) Also delete the small polygon in "MyWsh.shp" that was delineated from the old point #2 by making sure that MyWsh.shp is the active Theme, selecting Theme / Start Editing, selecting the small watershed using , and selecting Edit / Delete Features. Click Theme / Stop Editing and save the edits.

Now click on to delineate the new watershed. You will have to enter "MyPoints.shp" and "MyWsh.shp" again. The program has kept track of which watersheds were already delineated so only the changed outlet location gets delineated again.

Before proceeding to the next section, you may want to remove the check marks next to the Themes Mywsh.shp, Mypoints.shp, Pourwsh.shp, and Pourpnt.shp to remove clutter from your view. You can also delete any of the features in these Themes if desired.

3. Delineating the area draining to a line segment.

Interactive selection of segment endpoints

To delineate an area that drains to a river segment rather than to a point, select the Tool and then click on two locations in the stream network. Click "YES" to perform delineation on the section you have chosen. When computations are complete,you will be asked whether you want to save the delineated area to "SECT-files." Click "Yes" and you will get another message telling you that "SECTWSH" is not identified. The program is looking for a Theme in which to save the results of any delineation made from a river segment. Click "Cancel" and then click "YES" to create a new Theme called "SectWsh.shp." The program also looks for a point file in which segment endpoints will be stored ("SECTPNT") so you will get another message box saying that "SECPNT is not identified." Click "Cancel" and then "Yes" to create "SectPnt.shp." Lastly, the program looks for an Arc file in which to store a straight line connecting the two selected endpoints so you will get another message saying that "SECTARC is not identified." Say "Cancel" again and then "Yes" to create SectArc.shp. You will now see a menu like the one below that allows you to enter identification information about the stream segment.

Click OK and you are done. The watershed polygon draining to the segment you identified with the mouse is stored in Sectwsh.shp. If you go on to delineate another segment, then you will not have to see all of the message boxes involved with creating the output shape files.

4. Delineating an area draining to and from a polygon feature

An example of how this Tool might be used is to delineate the area draining to and from "areas" identified as sources of non-point source pollution. In the current version (5/15/97)of this program, only a tool for defining a rectangular shaped source area is available.

(It is probably a good idea to Zoom into a portion of the Sabine basin to perform the following tasks so that it is easier to see what is going on.) Click on to create a rectangular polygon for which you wish to know the areas draining to and from. Your cursor will become cross-hairs. Click on the view with the left mouse button and hold the button down while dragging to create a rectangle. Release the mouse when you get a rectangle you like. As soon as you click the mouse, the program will tell you that "POLYPLY" is not identified if this is the first time you are adding a source polygon. The Theme that will hold "source" polygons needs to be created. Click "Cancel" to create this Theme and then use the cursor to draw a rectangular "source" polygon in the View. This polygon is stored in a shape file called "PolyPly.shp."

Click on the Button to delineate. You will get a message box asking you to type the name of the Theme containing the polygon source areas. Just leave the default "PolyPly.shp" and click OK. If this is your first polygon source delineation, you will get a message saying that "POLYWSH" is not identified. This Theme will contain the shapes of delineated areas. Click "Cancel" to create this Theme. You may also get a message saying that "POLYRIV is not identified." Click "Cancel" to create this Theme as well.

Place a check mark next to the Theme "Polywsh.shp" to see the result. Two polygon shapes are visible in this Theme. One is for the area up-drainage from the rectangular source and the other is for an area down-drainage from the rectangular source. The down-drainage polygon stops when all the flow converges to a single cell, so this polygon might not flow all the way to the streams in sabstr45.shp, depending on where your source area is located. You may think the results of this delineation look strange or very strange, but this program really works. If you don't believe it, try using the drainage path tracing tool several times to convince yourself. Strange looking drainage patterns are most likely due to the resolution of the DEM and the assumptions associated with using the eight-direction pour point model.

Setting up the input data for your own study area (pre-processing)

Here is a procedure that can be used to prepare data for use with this Watershed Delineation Application. This procedure requires both Arc/Info and ArcView. As soon as this ArcView 3 watershed delineation application is complete, this procedure will only require ArcView and not Arc/Info. At that time, these instructions will change drastically.

1. DEM Pre-Processing : Creating Base Streams and Watersheds

The design of the watershed delineation system currently requires a pre-processed set of gridded streams and watersheds. Having a pre-processed set of subwatersheds improves processing speed for large basins because not all DEM cells upstream of a selected outlet point need to be processed if the selected point is on the main river and includes drainage from several subwatersheds.

Pre-processing the DEM involves creating a standardized watershed and stream network or base map similar in concept to EPA's Hydrologic Cataloging Units (HUCs) and River Reach Files (RF1) files, although the base maps that you will be creating here have more strict requirements about topological relationships in the drainage system, and the watersheds in these base maps are consistent with the digital elevation model. Having a hydrologic base map provides a reference frame and is extremely valuable in defining a study area.

To get you started, a filled DEM is provided to demonstrate the procedure of creating a base map. This DEM is much smaller than the Sabine River Basin so that it will be faster to work with.

The name of the DEM is "sampdem" and it is located on the CD-ROM in the directory ~/terrain/av3delin/gisfiles/sample. Make a new directory on your hard disk called setup. In this directory, create the following subdirectories so that your directory structure will be the same as what the watershed delineation application expects: demdata, prepdata, tmp, and usrdata. Move into the directory ~/setup/demdata and copy the sample dem to that location using the Arc/Info copy command:

Arc: copy <your_cdrom_path>/gishyd97/terrain/av3delin/gisfiles/sample/sampdem

An AML called delin.aml has been written that will automatically delineate a set of watersheds for the base map.

For a more detailed description of the steps required to obtain a 3" Digital Elevation Model and the processing steps used in delin.aml see Exercise 2: Delineation of Watersheds and Streams

Once you have sampdem and delin.aml in the demdata directory, start Arc/Info and enter Grid from this directory, and run the AML called delin.aml by typing:

Grid: &r delin

To view the contents of this AML click here.

You will be prompted for the name a filled DEM.

Type sampdem.

After the flowdirection and flowaccumulation are computed, you will be prompted for a threshold value.

Type 10000

After the delineation is completed, start ArcView3 and open the project tnrcc.apr that you have copied to your ~/setup directory. You might note that the Spatial Analyst extension is automatically loaded with this project.

Add the the following coverages and grids that you have just created in ~/setup/demdata using delin.aml to the View "TNRCC-Sabine":

covstr {stream arcs}

str {stream grid}
fdr {flowdirection grid}
fac {flowaccumulation}

Be sure to add both the arc and polygon layers of covwsh. You may want to hide the legends for the Grids using Theme / Hide/Show Legend so these legends don't take so much room on the Theme pallette.

2. Modifying Base Stream and Watershed Coverages So that the River Network Can be Traced

A series of Scripts need to be run to modify the river line Theme and watershed polygon Theme so that the river network can be traced using Avenue. These steps are described below. It is a good idea to make the stream and watershed Themes visible so that you can see what is going on during these steps.

You are now ready to use the delineation tools. There is one more pre-processing step that occurs the first time you delineate a point that is not in a headwater basin. This step is to create a shapefile with pre-merged subwatersheds. Try delineating a point that is downstream of at least one subwatershed using . You will get a message telling you that the pre-merged watershed is not identified. Click "Cancel" and "Yes" to construct a Pre-Merged watershed shape file. Say "Yes" to build the control-list. Click OK to write the shapefile called "Mgcovwsh.shp" to disk. You you will now see the same series of messages that are described in the description of above.

These materials may be used for study, research, and education, but please credit the authors and the Center for Research in Water Resources, The University of Texas at Austin. All commercial rights reserved. Copyright 1997 Center for Research in Water Resources.