Exercise 2: Digital Watershed Delineation and CRWR-PrePro
CE 394K.3 GIS in Water Resources
University of Texas at Austin Spring 1998
By Seth Ahrens, Francisco Olivera and David R. Maidment
Table of Contents
Goals of the Exercise
For several years, the Hydrologic Engineering Center (HEC), located in Davis, California, has distributed the surface-water modeling package, HEC-1, which is used for flood hydrograph and discharge computation. The HEC is in the process of releasing a replacement program for HEC-1, entitled the Hydrologic Modeling System (HEC-HMS). This new program, complete with a modern graphical user interface, allows the user to model hydrologic systems much more easily with its point-and-click presentation.
The ArcView GIS and its Spatial Analyst extension provide tools for watershed delineation from digital elevation models, which have been further developed by the Center for Research in Water Resources (CRWR) at the University of Texas at Austin and other organizations. The watersheds and stream networks produced by these tools can be used as templates to define watershed and stream properties using GIS and to produce the input files needed by HEC-HMS and other hydrology and water quality programs. At CRWR, there has been developed a system of Avenue scripts for ArcView, called CRWR-PrePro, which accomplishes digital watershed delineation, hydrologic parameter determination, and preparation at this time of an input file for HEC-HMS. In the future, CRWR-PrePro will be able to preprocess data for a wide variety of modeling packages. The first research on developing this tool was done by Ferdinand Hellweger, and more recently the effort has been continued by a team led by Francisco Olivera, and including Seann Reed and Brian Adams.
The goals of this exercise are:
Computer and Data Requirements
Before you may begin to work with CRWR-PrePro, you must first copy several files to your account. Since many of these files are large, you should work via the c:\temp directory of the machine you are using in the LRC. Once in the c:\temp directory, execute the following commands:
To explain briefly what you have just done, the txdo0409.apr file is an ArcView file which contains the ArcView Scripts and Menus which comprise CRWR-PrePro. The gisdata directory contains GIS-based information you will use during this exercise. Finally, tmp is the directory where all of your work will be stored as you move through the procedure. As this point, you must call this directory tmp since CRWR-PrePro will look specifically for this directory.
This exercise requires that you have running ArcView Version 3.0a, coupled with the Spatial Analyst Extension, Version 1.1. A portion of the exercise, involving conversion of gridded streams to vector streams will not execute if you are using an earlier version of the Spatial Analyst.
1. A Digital Elevation Model in ArcView
Let's begin by viewing the digital elevation model in ArcView. To start ArcView under Windows NT, use the menu system to access:
Start/Programs/Esri/ArcView GIS Version 3.0/Arc View GIS Version 3.0
Under File/Extensions, check that you have the ArcView Extension Spatial Analyst installed in your system. Open the ArcView project txdo0409.apr by selecting File/Open New Project from the ArcView main menu. The ArcView project txdo0409.apr will call and enable the Spatial Analyst. Notice that your working project is now called txdo0409.apr. If you double-click on View1 in your project window, your working area, called View1, will appear. It is in this window where most of the GIS work you are going to do will be accomplished.
Adding the Digital Elevation Model (DEM)
For this exercise, we are going to focus on a central region of the Colorado Basin in Texas. To load the DEM of this region, highlight the View1 window in ArcView and click on , which allows you to add a theme to your view window. After making sure that the Data Source Type in the Add Theme window is set to Grid Data Source, choose cntcol_dem from your gisfiles directory. At this point, your view window should contain the following image:
These data represent the elevations present in the area we wish to study. To see some characteristics of the Grid, highlight the theme Cntcol_dem, and open the Theme/Properties window. The cell size and map units are in meters for both horizontal and vertical distances. If you use the i tool in the View window, you can click on the Grid at various points and see its elevation. In the enquiry box which appears, you'll see two numbers reported: Value, the elevation of the Grid cell, and Count, which is the number of cells having that elevation.
To be turned in:
(1) What is the cell size in this grid? How many rows and columns does it have? What area does it cover (km2)?
(2) What are the coordinates of the lower left corner of the Grid and the upper right corner of the Grid? What area is enclosed by the rectangle having these as its lower left and upper right corners?
(3) What is the range of elevation of the cells in the Grid?
2. Using the Hydro Menu
This project is customized with special menu options for CRWR-PrePro. The primary menu of interest is the Hydro selection, located on the main-menu bar of ArcView. The following image shows your options when you access this menu:
Except for a few items, we will systematically march through the selections in the menu to achieve the conversion from the DEM to a HEC-HMS input file. The following list is a summary to give you a background as to which each step accomplishes:
A. Processing the DEM
B. Stream and Watershed Delineation
C. Computation of Watershed and Stream Attributes
D. Constructing a Basin Schematic using CRWR-PrePro
3. Processing the Digital Elevation Model
A. Set Analysis Properties Before you can fill in the DEM, you must first tell ArcView what part of the view it is to analyze. Keep in mind that at some point, you may want to do something to only part of a DEM, so do not think that this is a redundant step. Nonetheless, select Analysis/Properties from the main ArcView menu to call upon the Analysis Properties window. Set the Analysis Extent at the top of the Window to Same as Cntcol_dem and the Analysis Cell Size in the middle of the window to Same as Cntcol_dem. Be very careful to make sure that you have done both parts of this step correctly, or otherwise errors will arise later!! Once you have verified this step, select OK.
B. Fill the Sinks The next step is to fill in the sinks. To do this, simply choose Hydro/Fill Sinks. When prompted for the Input Theme 1, type in Cntcol_dem. You may choose any name you wish for the Output Theme 1 (FilledDEM); however, it is recommended to the default names where possible since you will be creating multiple files in this exercise. Hence, for this example, FilledDEM is chosen as the output file name. Click Ok to Run the function. You'll see the blue bar go across the bottom of the View Window to indicate that processing is occuring. When it is completed, the FilledDEM will be added to the View Window.
C. Make a Copy of the Filled DEM At this point, to avoid a glich in the representation of the filled DEM, we are going to make a copy of it. To do this, make the new filled DEM the active theme and select Theme/Properties from the main menu. Note the location of the filled DEM (e.g. c:\temp\prepro\tmp\Demfil1) on the Source line in the Theme Properties box. From here, close the Properties box by selecting Cancel and go to File/Manage Data Sources on the main menu. Go to the location you earlier noted on the Theme Properties Source line, and select the listed file (make sure you have Source Types Grid selected). Then choose the Copy button in the right half of the Source Manager window. You will then be prompted for the name of the copied version of the filled DEM. Choose whatever you wish; for this example, choose colfil to stand for the Colorado basin filled DEM. With the copy completed, close the Source Manager window with Cancel. To finish this process, select to add the copied DEM you just created. You should now have three DEM's on your screen--the original DEM (Cntcol_dem from above), the filled DEM with the choppy graphics (FilledDEM), and the newest copy of the filled DEM (fillcopy), which should look OK. Go ahead and removed FilledDEM by making it active and selecting Edit/Delete Themes from the central menu.
D. Compute the Flow Direction Grid With the DEM filled, the flow direction and flow accumulation calculations may be performed. Simply choose Hydro/Flow Direction, enter the name of your filled DEM (colfil) for the Input Theme 1, choose a name for Output Theme 1, (e.g. colfdr for Colorado Flow Direction) and select OK. After a minute or so, a flow direction grid will appear. Here is what it looks like:
This doesn't look too interesting. To see a better view of the flow direction Grid, double click on the legend bar to open the Legend editor and the Load button in the upper right corner to load a specially constructed Legend file in the gisfiles directory called fdr.avl, which colors the Flow Direction Grid in a more understandable way.
Note that the values under colfdr represent which way water will flow from a given grid point keeping in mind that 1 indicates east, 2 southeast, 3 south, and so forth.
E. Flow Accumulation Grid The flow accumulation calculations are performed in a similar manner--choose Hydro/Flow Accumulation, select your input (colfdr) and output themes (colfac), and press OK. If you view the flow accumulation theme carefully, you should notice a faint stream moving off to the lower-right-hand corner of the screen. Keep in mind that the darker the color of an individual grid cell, the more grid cells drain into that particular cell.
At this point, you'll have a number of Grid legends in the View Window. To be able to see all the theme names at once, highlight the theme and use Theme/Hide Legend to collapse the theme legend and just show the theme name. If you depress the Shift key and highlight several themes at once, you can hide all the legends with one command of Theme/Hide Legends.
To be turned in: What is the maximum flow accumulation (number of cells) in this Grid? What drainage area does this correspond to in km2? Where does this maximum flow accumulation occur?
4. Stream and Watershed Delineation
A. Define the Basic Stream Network The next step in the pre-processing requires you to define the minimum stream drainage area. First select Hydro/Stream Definition (Threshold). Type in the name of your flow accumulation theme (colfac) as the input theme and choose an appropriate output theme name (colstr). When asked to pick the minimum number of cells to define a stream, take some guesses as to what you think might work. Keep in mind that the area we are using is about 500 x 500 cells and that each cell is a five-hundred-meter square. After you have tried some different values, delete the themes you feel are unreasonable. For this problem, a good value is a threshold of 1000 cells. This corresponds to a minimum drainage area to begin defining a stream of 1000 * 0.5*0.5 km2 = 250 km2. The output grid from this step, colstr, has a value of 1 in all cells for which colfac > 1000 and NODATA on all other cells.
B. Adding a Point Coverage of Gage Locations Now that you have defined your streams, we are going to add a coverage of points which represent stream gage locations on the streams. To do this, click on and select ctxstat.shp from the gisfiles in your working directory. Make sure that the Data Source Type is Feature Data Source! The following image should look similar to yours since a stream-definition value of 1000 cells was used for this image:
Note that I have hidden the legends for most of the themes so that it is easier to see which themes comprise the view. If you are interested, you may add/remove theme legends using Theme/Hide-Show Legend. It appears that a 1000-cell threshold for this system is adequate since just about all of the points fall closely to a stream. For your curiosity, you may want to zoom into some locations to see how close the points actually are.
To make things interesting, assume that for some reason a point is missing from our ctxstat.shp coverage and that we would like to include it. To add this point, make ctxstat.shp the active theme. Choose Theme/Start Editing from the main menu. After that, click on the icon, which tells ArcView that you wish to add a point to the coverage. Select a position somewhere in your view which is not close to a stream and add a new point. Since one point is good enough for demonstration, now tell ArcView you are finished editing by selecting Theme/Stop Editing from the main menu and by selecting Yes when asked if you want to save the edits.
C. Adding New Streams Now that you have a point away from the existing stream network, you need to trace a new stream from the added point to an existing stream. To do this, select the tool button. Once you have done this, click on the point you just added to the ctxstat.shp coverage. This action causes a stream to be drawn from your new point to the proper stream. You should now have a new coverage called Addlines.shp which contains the flow line from your new point to the edge of the DEM. Here is an example. Keep in mind that the added stream has a new color so you can see it better. Pretty Cool!
Since we recently added another stream segment to the existing network, ArcView now thinks we have two stream coverages when in reality we wish to have one. To circumvent this problem, select Hydro/Add Streams and then enter the proper names for input themes one through three (Addlines.shp, colfdr, colstr). Finally, select an output theme name (colstr1) and click on OK. In addition, select YES when asked if you want to use traced and threshold streams. Notice that your new modified stream grid is a combination of the old stream grid (created from the cell threshold) and the new stream grid (created when we added a point in the coverage).
D. Stream Segmentation into Links As you know, the HEC-HMS models surface-water movement. To attack the problem, the model breaks down a system into sub-watersheds where each watershed has one outlet point. To move toward converting the data set we have now into one the HEC-HMS can handle, we are now going to create links in our network. These links are demarcated using Hydro/Stream Segmentation. The input themes are your flow direction grid (colfdr) and your modified stream grid (colfstr1), and your output theme is the links grid (collnk). Be sure not to use your earlier stream grid, colstr or you won't include the stream segment that you added manually in the previous step.
To understand better what a link actually is, consider a small piece of this screen.
Each differently-colored element represents one link in the model. Notice the length of the legend in this example. In any coverage with a variety of values, you may color each one uniquely by double-clicking on the original color under the theme name, which brings up the Legend Editor. For this example, Unique Value was chosen for Legend Type, Value in the Values Field, and The High Seas for the Color Scheme. Experiment with some other set-ups if you are interested.
E. Finding Link Outlets Further preparation for the HEC-HMS requires ArcView to pinpoint the end of each link. This is done by choosing Hydro/Outlets From Links from the main menu. For the input, type in the names of your flow accumulation (colfac) and link grids (collnk); for the output name, choose something reasonable (colout). The resulting grid is a scattered set of single cells, each the farthest downstream cell of a stream link. Notice that each link has its own outlet. Zoom in to see how the outlet cells lie right at the end of the links. Pretty neat!
F. Adding Outlets To commence the next step, suppose that we wish to add some gage locations from the ctxstat.shp coverage as drainage watershed outlets. The gage locations may not fall exactly on a stream. For example, zoom in closely on the farthest-left point in the coverage. It is necessary to ensure that each outlet is on a gridded stream. To fix this problem, select the tool button. Now choose at least five gage locations in the ctxstat.shp coverage, zoom in to each point, depress the button, and choose a location on the stream which is nearest to the ctxstat.shp point you have magnified. Repeat this process for all of the other gages you've chosen. When you finish, combine your newly-created outlets with the previously-established outlets by choosing Hydro/Add Outlets and inputting the required theme names as needed (Input Theme 1 - collnk, Input Theme 2 - colout, Input Theme 3 - Addasoutlets.shp, Input Theme 4 - colstr1, Input Theme 5 - colfdr, Outlet Theme 1 - colout2, Outlet Theme 2 - collnk2). Make sure you include the "shp" at the end of your add-as-outlets theme. Once the function has run, compare the number of links and outlets that you now have compared to the number you had earlier. That number should have increased by the number of new outlets at gage locations that you just added.
G. Delineate Watersheds With the links and outlets finalized, ArcView can now delineate the watersheds in the system. After choosing Hydro/Sub-Watershed Delineation, update the DEM Pre-processing window as needed, using colout2 as the OutletsGrid, select a name for the watershed grid (colshd) and select OK. The result is a zone of cells draining to each outlet that has the same number for every cell in the zone as the number in the outlet cell.
As an example, the graphic below contains sample results to this point. Note that the watershed colors have been changed to greenish and the stream grid has been changed to blue.
You should also perform a cursory check to make sure that the number of sub-watersheds you calculated equals the number of outlet points since each sub-watershed requires an exit point. To check this, highlight one of the themes (colshd) and depress the button. The upper-left-hand box of the main window should tell you how many items are in the theme you have selected. Perform the same process on the other theme (colout2) and make sure the number of records is the same. With the table open for your watersheds grid, you can depress the Count Field, and then use the Field/Statistics menu to get summary statistics of the watersheds you have just generated.
To be turned in: How many watersheds did you generate? What was the average number of cells in a watershed? What is the ratio of the average watershed area to the threshold area used in defining the basic stream network (1000 cells)? How many cells are in the smallest watershed? How many in the largest watershed?
5. Vectorizing the Streams and Watersheds
A. Vectorize the Stream Grids Up to this point, we have been working primarily in a grid (raster) environment. Granted items such as ctxstat.shp are vectors, but most everything else is in a gridded form. Since the HEC-HMS cannot handle these raster data, we need to convert everything into vector form. The first step in this process is Hydro/Vectorize Streams; once you have chosen this, complete the Convert Line Grid window (pay attention to the name of the LinkGrid you choose, collnk2). Call the vectorized streams colriv and once the function is run you'll see a Colriv.shp line theme appear. This is the step that requires the Spatial Analyst Version 1.1. If you don't have version 1.1, the Gridline function in Arc/Info can be used instead.
B. Vectorize the Watershed Grids To vectorize the sub-watershed boundaries, choose Hydro/Vectorize Watersheds and complete the required input. You should take some time to compare the raster and vector versions of each stream/watershed combination with each other. Use colwshed as the name for the polygon theme of the outlet watersheds.
C. Cleaning up Dangling Polygons Though the pre-processor has almost finished its job, there are subtleties which need to be addressed. First, vectorizing watersheds can create an item referred to as a dangling polygon. These occur when ArcView has trouble converting a grid to a vector; the end result is basically a super-tiny watershed that does not really exist. You can check how many of these dangling polygons you have by opening the tables of the colriv and colwshed themes and checking the number of records in each table. You'll probably find more watershed records than river records whereas they should be the same number. To eliminate this problem, choose Hydro/Dissolve Dangling Polygons. When asked to make a back-up, I would recommend you choose Yes, just to protect yourself. Once the calculations are finished, ArcView will inform you of the number of dangling polygons found. You can thus check that the correct number of dangling polygons has been removed. If you open the tables for the river and watershed themes, you should now find they have the same number of records.
D. Building a Connected File Structure Now we need to associated each subwatershed with the stream reach or link that flows through it, and build the drainage network so that we know for each stream reach and subwatershed what is the next downstream reach which receives its water. To do this, use Hydro/Process Watersheds and Streams with mgcolwshed.shp as the output theme for the merged watersheds. This theme is a bounding polygon for the drainage area of each outlet at the edge of the grid. It is like a basin boundary theme, as distinct from a subwatershed theme that we produced earlier. If ArcView asks you whether it should run hydro.DemPstMgSet because it cannot find the file plylist.ctl, choose Yes.
To be turned in: a map showing your vectorized stream and watershed network.
6. Calculate Attributes and Run CRWR-PrePro
A. Determine Watershed and Stream Attributes One of the last things to do before moving to the HEC-HMS system is to include SCS curve-number data for the region. The HEC-HMS requires this information to perform run-off calculations. We will skip the steps Soil Group Percentages and Curve Number Grid from the Hydro menu, because they are time consuming and they result in an SCS curve number grid that we will just import and use in this exercise. To add this coverage, select curvenum (remember that it is a grid source) from your gisfiles directory. Once you have done this, select Hydro/Calculate Attributes and complete the table so that the weighted curve number for each watershed may be determined. Use curvenum for the Curve number grid, and collong for the Output Theme 1 name. If you look at your themes colriv.shp and colwshed.shp, you'll see that their tables now have many new hydrologic attributes calculated for them, such as Muskingum routing coefficients for stream reaches and SCS curve numbers and lag times for the watersheds.
When asked which time-step you would like for the HEC-HMS, first select "1-12 hours" from the first pull-down menu and 1 hour from the second menu. When prompted for a stream input file, choose streamp.txt from your gisfiles directory. This table gives reference values for the stream velocity.
B. Clip out the Basin that will be used to Create the Hydrologic Model The final step involves selecting which parts of the watersheds are to be modeled. Consider the following image, which only has the streams and the addasoutlets themes active.
Note the blue dot in the View window. The dot is there to let you know that we are going to model this watershed from that point upstream in the watershed. To fill in ArcView on this plan, first depress the button, select Yes when asked if you want to snap to a river section, and then select a point of interest to you. Try to choose a point whose drainage area is entirely within your grid boundary, otherwise part of your drainage basin will be outside the region you've analyzed. After you have selected your point of interest, choose Yes if you are satisfied with the point you have chosen. Within a few seconds, ArcView will color the area it thinks you want it to send to the HEC-HMS; again if this point is satisfactory, select Yes. The following image represents the area of the watershed we plan on sending to the HEC-HMS.
C. Add CRWR-PrePro Transfer Tables Before executing the CRWR-PrePro, one last item needs to be addressed. As part of the process of creating the basin file, CRWR-PrePro incorporates a variety of transfer tables in its calculations. Since we have not given CRWR-PrePro any of these tables to use, click on the Tables icon in your project menu and then select Add. From your gisfiles directory, choose hecdiv.dbf, hecjunct.dbf, hecreach.dbf, hecres.dbf, hecsink.dbf, hecsourc.dbf, and hecsub.dbf. It is extremely important that you get all of the data-base files for CRWR-PrePro to work correctly, so check carefully that you have transferred all of them.
D. Run HEC-PrePro Finally, for the moment of truth, highlight both the watershed and river themes that you clipped from the original area (clipst1.shp and clipsh1.shp) and select Hydro/Run HEC-PrePro. Since we are using a 500-meter DEM, select a value of 360 for Tolerance2. Select Y for the transfer attributes, and any names you wish for the output file (colorad) and output description (Colorado Basin Delineation). At its conclusion, the file looked like the below image. CRWR-PrePro determines which streams are channels (Hydrop and Hydrol) that carry water from subwatershed outlets and defines a schematic layout over the drainage basin and stream network showing how it is hydrologically connected (Symp and Syml).
Having hidden the Symp and Syml themes, let's take a closer look at the piece of the view I chose to send to the HEC-HMS:
In sum, each black dot represents the most-upstream point of each defined stream. In addition, the blue dots are the outlet points from each sub-watershed. Green lines indicate a flow channel (i.e. the HEC-HMS will need to route water through these sections), while the red dot is the sink of the system. Not bad, eh??
To be turned in: a map showing the streams and watersheds selected for the hydrologic model as depicted in ArcView.
7. Import the Model into HEC-HMS
To view the basin model you just created in the HEC-HMS environment, you will first need to start the model using
Once the program has loaded, you may view your image by selecting Edit/Basin Model/Import from the main menu. Then, find your *.basin file in your tmp directory and select it. When it first loads, your basin model will appear scrunched up in the upper-right hand corner of the viewing screen. For a better view of the model, zoom toward your image using the icon in a fashion similar to how you would zoom in when using ArcView. Here is a copy of my basin model:
Take some time to compare the GIS-based version of this basin to the HEC-HMS version. You may learn about a watershed (green boxes) or a river reach's (blue line with black borders) attributes in the HEC-HMS by selecting one and holding down the right mouse button. From the pull-down menu which appears, select Edit. For a watershed, you may view its area as well as its SCS curve number, which we calculated earlier using the curvenum grid in ArcView. For the river reaches, you may learn about the routing method. Each reach is either routed using a Muskingum technique or a lag-time technique. Again, this was previously calculated in the ArcView environment.
At this point, you have essentially completed this project. In an ideal situation, we would link the basin model in the HEC-HMS with rainfall and timing parameters so that we could actually run the model. However, time is limited, so we shall stop at this point. Hopefully, however, you have learned a good deal about the power of CRWR-PrePro and now have more interest in GIS-related hydrology. For more information on HEC-HMS, see the companion exercise, Introduction to HEC-HMS.
To be turned in: a screen capture of the schematic layout of the model in HEC-HMS
8. Clean Up
During this exercise, you've created a large number of files in the c:\temp directory. Please delete all these files so that the temp space is available for next user of the machine.
Ok, you're done!
Back to class home page.