FAO/UNESCO Water Balance of Africa

Exercise 4: Introduction to Terrain Analysis

Prepared by
Ye Maggie Ruan, David R. Maidment and Francisco Olivera
Center for Research in Water Resources
University of Texas at Austin
Adapted for Africa by
Kwabena Asante
October 1997

Table of Contents

Goals of the Exercise

This exercise is intended to instruct you on how to delineate watersheds and stream networks of interest using Digital Elevation Model (DEM) data. The Blue Nile Basin is used as the example for this delineation. This exercise is based on the global 30 arcsecond resolution (approximately 1 kilometer square cells) digital elevation models produced by the US Geological Survey as part of the GTOPO30 project. The raw DEM of Africa has been projected and filled, and the flow direction has been computed to obtain the grid used in this exercise. These DEMs were developed during the creation of the Watershed and Stream Network coverages of Africa.

After finishing the exercise, you are expected to be able to a watershed and stream network in an area of your choice.

Computer and Data Requirements

The whole exercise will be conducted in Arcview3 with the Spatial Analyst and Hydrologic Modeling Extensions. It can be executed on either a PC or an Unix workstation.

The data for this exercise include

Internet students can download the necessary files.

Getting Acquainted with Data Sets of Africa

Creating the Workspace

Begin by making a workspace on your local machine. Make a subdirectory called ex4 in the C:\temp\ directory, and a subdirectory called gisdata under ex4. This is the directory to which all files created during the exercise will be written.

View the Data Sets of Africa

Start an Arcview3 application by clicking on the ArcView icon. When Arcview is first executed, a new Untitled Project window is opened. This window includes several icons marked Views, Tables, Charts, Layouts, and Scripts. This is the main Project window, which allows you to create new Views, Charts, etc., or to open existing ones that you have already created in that project.

First of all, you need to make sure that both Hydrologic Modeling and Spatial Analyst Extensions are active. Click on File/Extension, a list of available extensions appears. Make sure both Hydrologic Modeling and Spatial Analyst Extensions are selected, click OK.

With the View icon highlighted in the Project window, click on New for a new view. Drag the View window out of the way and resize it if necessary. Add a new theme to the view by clicking on the Add Theme button on the top tool bar. Go to your CD drive, click the directory afrgrid under africa directory. Highlight the flow direction grid, fdr and the raw DEM, afrodem. Notice that since fdr and afrdem are grid data, you have to change the Data Source Types in the Add Theme window to Grid Data Source instead of the default Feature Data Source. (The fdr grid is in afrdata directory, if you click on fdr folder, and don't see any thing, you have gone too far. Go up one lever). Hold down the Shift key while selecting the second grid. Click OK to add the two grids to your View window. Notice that you cannot see both grids in the same View. This is due to the fact that the two grids are in different projections. Delete the flow direction grid by making it active and choosing Edit/Delete Theme in the View menu. Display the raw DEM by clicking on the little box next to afrodem in the View menu.

The DEM appears to be devoid of features and contains an 'unusually range' of elevation high values. In developing the data set, areas below sea level area assigned a high value (65335 - elevation of cell below mean sea level). Cells within a water body are also assign a high value (55537). This value is assigned because grids cannot contain negative values. Part of the preprocessing of the DEM involves the removal of this high value to ensure that the elevation in each cell is correct relative to its neighbouring cells. A more representative topographic map of Africa can be obtained by using the legend editor to classify the cell values into 9 classes with natural breaks.

Terrain Analysis based on Digital Elevation Model (DEM)

In this part of the exercise, you will delineate watersheds and stream networks at different thresholds using DEM. You will use Arcview Hydrologic Modeling Extension to conduct most of the work. This part of the work (database creation) is usually done in Arc/Info. In this exercise, you will use Hydrologic Extension to perform some the same processes in ArcView. For a more complete description of the steps refer to the Blue Nile Delineation or Urubamba River Terrain Analysis exercises.

Processing the DEM of Africa

The process of watershed delineation from the raw DEM begins with the projection of the raw DEM from geographic coordinates onto a flat surface. The types of map projections that are commonly used and their effects on surface area and shape are described exercise 2 on Map Projections. This projection is done in Arc/Info (not ArcView). The map projection and coordinate system used in creating the Africa Data Sets are as follows:

Projection Lambert_Azimuthal
Datum WGS84
Zunits Meters
Units Meters
Major Axis 6378137.00000
Minor Axis 0.000000
Radius of sphere of reference 6378137.00000
Longitude of center of projection 20 0 0.000
Latitude of center of projection 5 0 0.000
false easting (meters) 0.00000
false northing (meters) 0.0000

In order for water to "flow" across the landscape, any spurious pits have to be filled in. This is usually done in Arc/Info as well but the Fill function under the Hydro menu can also be used to fill these pits in the projected DEM. This has already been done for the African Data sets. The next step is to calculate the flow direction grid. The cells flow to their nearest neighbor along 1 of 8 compass directions labeled as East = 1, SE = 2, S = 4, SW=8, W=16, NW=32, N=64, NE=128. The flowdirection function assigns to each cell a number corresponding to which of the 8 neighboring cells lies on the path of steepest descent. The Flow Direction function under the Hydro menu can be used for this computation. A Flow Direction grid, fdr, has been computed for the whole of Africa on a 30" resolution grid, using the GTOPO30 DEM.

Extracting the Blue Nile Basin Flow Direction Grid

Open a new view by double-clicking on the view icon in the Project window. Click on add themeto add in the Blue Nile river and basin coverages bnileriv.shp and bnile.shp from your workspace, and the flow direction grid of Africa fdr from the afrdata directory on the CD-ROM.

Make sure the theme are arranged in the order bnileriv.shp, bnile.shp and fdr from top to bottom in the View legend. Make fdr the active theme, and click the Full Extent button to set the window for the whole of Africa. You now need to reshade the flow direction grid to give you a better sense of what is happening on the land surface. A legend has already been created and stored for you in the afrdata directory on the CD ROM. The legend called flowdir.avl was created from the flow direction grid by choosing the options Graduated Color for Legend Type, Value for Classification field. The number of classes was set to 8, and the range of values in the Value window of the legend editor were set to 1, 2, 4, 8, 16, 32, 64 and 128, from top to bottom. The Color Ramps field was set to Grays to Reds dichromatic. The legend was saved by clicking the Save button in the Legend Editor. Retrieve this legend by clicking Load and browsing through the directories to locate the .avl file.

Apply the retrieved legend to fdr. Zoom in a little closer and you can see the land surface beginning to take shape. You can make out the location of the valleys and peaks. You can also turn off the Blue Nile basin coverage to see how the river flows through the valley.

Make the theme Bnile.shp active, then click on zoom to the active theme tool Zoom to active theme tool icon. The View now only contains the area surrounding the Blue Nile basin. Next, click on Fdr in the View legend to make it active. Choose Properties under Analysis menu, and the Analysis Properties window pops up. Choose Same As Display for Analysis Extent and Same As Fdr for Analysis Cell Size, click OK.

Now you are going to use Map Calculator to retrieve the piece of the grid you need. Choose menu Analysis/Map Calculator, the Map Calculation1 window appears. Double-click on [Fdr] under Layers. You will notice that [Fdr] is recorded in the scratch pad. Click Evaluate. Map Calculator creates a grid which has the same values as Fdr but only contains the region displayed in the view. You should see a new grid called Map Calculation 1 appears in the View window. This is the flow direction grid for the Blue Nile basin. The grid, Map Calculation 1, is a temporary file. You need to save the data set to your workspace as Bnilefdr using menu Theme/Save Data Set. (Remember to make Map Calculation 1 the active theme before you save it). Load the flow direction legend, flowdir.avl, to get the correct shading.

Computing the Flow Accumulation Grid

The next step is to calculate flow accumulation grid. This grid counts all the cells upstream of a given cell.

Make the theme Bnilefdr active, choose menu Hydro / Flow Accumulation, you will see a blue bar moving at the bottom of the view - it is calculating! This process may take a while since this is a large data set. After the Flow Accumulation grid is shown in the view, display it and save it as bnilefac in your workspace using Theme/Save Data Set.

Watershed Delineation based on DEM

Now comes the last step, watershed delineation. You need to specify which flow direction grid and flow accumulation grid you will use for the watershed delineation. ArcView uses this as a check just in case you have more than one of each of the grids in the View. Choose menu Hydro / Properties, and in the resulting Hydro Properties window, enter the names of the flow direction and flow accumulation you want to use for watershed delineation. In this case, the names are just Bnilefdr and Flow Accumulation.

Make the theme Flow Accumulation active, choose Hydro / Watershed, the Watershed window asks for the minimum number of cells for a basin. You will get a different result depending on the threshold value of flow accumulation you choose. Remember that the threshold value specifies the minimum upstream drainage area necessary to define a stream. The cell size is approximately one kilometer by one kilometer wide. The area of each cell is 1 x 1 km = 1 km2, so 1000 cells = 1000 km2 in drainage area, and 10,000 cells = 10,000 km2 in area. Let us delineate the streams for a 1,000 cell flow accumulation threshold. Change the default value from 500 to 1000, click OK. You will see a blue bar moving at the bottom of the view- it is calculating! (Simply click OK if any error messages are displayed during this step). After the Watershed grid is added to the View, click the check mark to display it. Use the legend editor to classify the watersheds into Unique values using Value as the classification field.

You have to convert the grid to a shapefile to be able to compare it with the Bnile.shp coverage extracted from the Africa Data Sets. Choose Theme/Convert to Shapefile, save the file as wshed1.shp in your workspace. Add the shapefile as theme to the View when prompted to do so.

In order to compare the delineated watersheds to Bnile.shp, you need to move the Bnile.shp to the top layer and make it shown as only outline. To do so, double-click on the color square under the name of Bnile.shp, a Legend Editor will appear. Double-click on the color square under Symbol, the Symbol Window will appear, which includes Fill Palette, Pen Palette, Mark Palette and Color Palette etc..

Fill Palette

In Fill Palette, click on the very upper left white square, then change the Outline to 2. If you want to change the color of the outline, click on Color Palette tool paint icon, this should invoke Color Palette. Change the Foreground next to Color: to Outline, then choose the color you prefer for the outline. Notice that the square box in the Legend Editor now shows the outline you specified, click Apply.

Notice also that the outlines of the watersheds from the different sources are very similar, however, the delineated watersheds are much more detailed than the Bnile.shp coverage. This is because the 1000 cells-threshold is relatively small. Delete the watershed grid by making it active, then choosing Edit/Delete Themes.

Now delineate the watershed at 2500 cells and 5000 cells thresholds, and choose Theme/Convert to Shape file, save you data as wshed2.5.shp and wshed5.shp in your workspace. Delete the Watershed grids. You will see that wshed2.5.shp resembles watersheds in the Africa Data Sets more closely..

Delineating Stream Network based on the DEM

You can also build your stream net work by Hydrologic Modeling Extension, and compare with RF1 file.

Choose Analysis / Map Query, and in the Map Query 1 window, double click the "[Flow Accumulation]" under the "layer" and ">", then type in 2500 (as the threshold of cell number), click Evaluate. A new grid of Map Query 1 will show up in View2. Map Query assigns a value of one to all the cells that have flow accumulation cell value greater than 2500, and value zero to all the other cells. drag the theme bnileriv.shp on the top of Map Query1 grid, you will notice that they are very similar, which means that the 2500 cell threshold is a good number to choose.

You may want to convert the Map Query 1 grid to arc shape file, so you can retrieve the arcs for the Blue Nile basin. You can not do this with Theme/Convert to Shapefile. It will only be converted to polygon shapefile. The current version of Hydrologic Modeling Extension does not support linegrid-to-arc function (linegrid command in Arc/Info). But this function has been implemented in the newer version.

Building Blue Nile Base Map based on the Watersheds delineated from the DEM

Each of the watersheds delineated from the DEM can be used to build the base map. Let's use wshed2.5.shp as an example.

Make the theme wshed1.shp active and displayed as top layer. Click on the Select Feature tool Select Feature tool. Hold down the shift key, and click anywhere within the area outlined by bnile.shp, until all of the polygons of wshed2.5.shp within the outline are selected ( highlighted ). Choose Theme/Convert to Shape file and save it as bnilebas.shp in your workspace. Now you have a second base map, which should be very similar to the first one you created.

Comparing the Results

When the results of delineation from the DEM are compared with stream networks from digitized stream, we notice that they are very close yet not identical. The reason is that there are many factors that would affect the watersheds and stream network, DEM is just one of them. We believe that the digitized stream networks such as the one found on the Digital Chart of the World, provide more accurate representation for the real watersheds and stream networks. For a terrain analysis that does not require high accuracy, the basic delineation procedure should be good enough, however, for a more detailed analysis, this could cause some problems. In this case, we would suggest that you use burn_in DEM instead of the regular DEM. For more information about burn_in DEM and the procedure for more detailed analysis, please refer to Spatial Hydrology of the Urubamba River System in Peru Using Geographic Information Systems (GIS) by Francisco Olivera, Ph.D. (Also available on the GISHYDRO97 CDROM).

Watershed and Flow Paths

In this final section, you will be able to determine the delineation of the watershed from any location on a grid stream. In addition, you will also be able to determine the delineation of the flow path downstream of any point within the watershed. To carry out this task, first move bnileriv.shp to the top of the theme list with wshed2.5.shp.shp directly under it. Next, move the flow direction grid, Bnilefdr under wshed2.5.shp. Finally, move the flow accumulation theme, Bnilefac under the flow direction theme. Once you have done this, turn the checkmarks on for the bnileriv.shp, wshed2.5.shp, and the flow accumulation, Bnilefac themes. Now make the flow direction theme the active theme. At this point, you will be to do one of two things. To delineate the watershed at any point on the grid, click on the "W" icon in the top menu. After you do this, click on any point within the basin. ArcView will determine the outline of the watershed in which this point resides. To view this watershed, turn on the checkmark next to the new watershed theme. Frequently, this watershed will be small compared to the basin, so you may have to turn off the checkmarks for Bnileriv.shp and wshed2.5.shp. Zoom in to make sure that you clicking right on the gridded stream.

After you have tested this feature, delete any watershed themes you have created using Edit/Delete Themes in the main menu. Turn the checkmarks back on for the Bnileriv.shp and wshed2.5.shp themes, and make the flow direction theme, Bnilefdr, active. Now select the "R" icon in top menu. Click on any point in the basin, and Arcview will delineate the flow path downstream from that point. An interesting thing to do after you have done this is to turn the checkmarks off all of the themes except for the flow directon theme. The flow path that is drawn on the flow direction grid may help read the flow direction theme more easily. The origin of each path is marked with a large dot as shown below.

Developing a Spatial Database of Interest

Now you've finished the whole exercise, you should be able to develop a base map, delineate the watershed and stream networks of the area of your interest.

Create a new workspace and try it!

Cleaning Up

When you're done with this part of the exercise, you'll need to clean up:

Simply delete the ex4 folder.

Ok! You're done!

Go to Dr. David Maidment's Home Page

Go to GISHydro97