Exercise 2. Building a Base Map of the San Marcos Basin

GIS in Water Resources
Fall 2009

Prepared by David R. Maidment

Goals of the Exercise

Computer and Data Requirements

Procedure for the Assignment

Creating a Geodatabase

Displaying Streams and Watersheds

Selecting the Watersheds in the San Marcos Basin

Creating a San Marcos Basin Boundary

Selecting the San Marcos Flowlines

Adding Attributes to the Flowlines

Creating a Point Feature Class of Stream Gages

Add Attributes to the Point Feature Class

Creating a Chart and Layout

Overlaying the Edwards Aquifer

Downloading USGS Flow Data

Summary of items to be turned in

Goals of the Exercise

This exercise is intended for you to build a base map of geographic and streamflow data for a watershed using the San Marcos Basin in South Texas as an example. The base map comprises watershed boundaries and streams from the National Hydrography Dataset Plus (NHDPlus). A geodatabase is created to hold all these primary data layers and a method for creating relationships inside the geodatabase is also illustrated. In addition, you will create a point Feature Class of stream gage sites by inputting latitude and longitude values for the gages in an Excel table that is added to ArcMap and the geodatabase. The table is used to create an XY Event and a Point Feature Class. You also compare the locations of the San Marcos basin surface boundaries, and the Edwards aquifer subsurface boundaries.  You’ll link to the US Geological Survey's Real Time data website in Texas, download some streamflow data and make a plot of a flow hydrograph from a gaging site on the San Marcos Basin.

Computer and Data Requirements

To complete this exercise, you'll need to run ArcGIS 9.3.1 from a PC.

The HUC boundaries are a subdivision of the US made by the US Geological Survey to show major and minor river basins. There are 2-, 4-, 6-, and 8-digit HUC boundaries, where the larger the number is the smaller the area. The HUC8 boundaries are the basic ones. Each of the 21 Hydrologic Regions in the US are shown below and for this exercise we will focus on Water Resources Region 12, which contains most of Texas.

The NHDPlus data for the United States can be downloaded over the internet:

NHDPlus http://www.horizon-systems.com/NHDPlus/

Get the NHDPlus data for Region 12:

http://www.horizon-systems.com/NHDPlus/data.php

For those ambitious students that would like the experience of downloading NHDPlus data for themselves, follow the instructions in this section. Otherwise, skip ahead to the Procedure for the Assignment Section where you will find a zipped file with all the necessary data.

Follow the link to get NHDPlus data, and click on the Region 12 location in the map (or another region if you want a different area of the country).

There you will download the following files and save them in a directory of your choosing:

-          Region 12, Version 01_01, Catchment Flowline Attributes

-          Region 12, Version 01_01, National Hydrography Dataset

Don’t download the grid files because they are not needed for this exercise and they are huge in size.

After extracting the zipped files, you should have something similar to the following:

Watershed Boundary DataSet  These data can be obtained from http://www.ncgc.nrcs.usda.gov/products/datasets/watershed/   Click on “Obtain Data” at this address, and then in colorful display that follows, go to the top left and say “Get Data”.  To get the data for Texas, select “Quick State” in the box on the lower left, and then select TX Texas in the drop-down menu that follows.

At Step 2, select 12 Digit Watershed Boundary Dataset 1:24,000

At Step 3, just leave the options as the standard ones: Geographic coordinates in NAD83 datum in one ESRI Shape File

At Step 4, fill in the delivery information:

Then go to Step 5 and the estimated download time is given.  When the file is ready, you get an email message, and then you download the resulting file via a web link.  In this case, the compressed file was 74MB in size.   I saved this file into a folder called WBD

And when unzipped, this creates a folder called hydrologic_units, whose contents look like:

These are shape files for the 12 Digit Watershed Boundary Dataset for Texas.

Procedure for the Assignment

Logon to the computer of your choice and make a directory in your workspace for this exercise. I've saved the needed files in the LRC class directory civil.ce.utexas.edu\class\class_files\MAIDMENT\giswr2009\Ex2 They may also be downloaded as http://www.ce.utexas.edu/prof/maidment/giswr2009/Ex2/Ex2Data.zip   This file is 156MB and the total file space used for this exercise is a little more than 1GB.  If you don’t have this amount of file space available to you, get the smaller file http://www.ce.utexas.edu/prof/maidment/giswr2009/Ex2/SanmarcosGDB.zip  and proceed to the section on Adding Attributes to the Flowlines.

Unzip the file to get the following:

In the HydrologicUnits directory that normally comes with the NHD file download, I have replaced

Creating a Geodatabase

Open ArcCatalog and create a new file geodatabase by right clicking the directory where the NHDPlus data is saved and selecting New/File Geodatabase and name it SanMarcos.gdb.

Right click on the new geodatabase and select New/Feature Dataset.

Name the new feature dataset Basemap, and hit Next to set the projection and map extent.

Select Import from the choices in the menu displayed.

We will import the coordinate system, so select Import and then navigate to the NHDPlus data that was just downloaded. Select the nhdflowlines shapefile.

Hit Add to select this horizontal coordinate system.  Hit Next and leave the Vertical Coordinate system set at None.

Hit Next and leave the default XY Tolerances as they are, then hit Finish to complete the specification of the spatial reference of the feature dataset. If you right click on the resulting Basemap feature dataset and open Properties, and tab to XY Coordinate System, you’ll see the coordinate system is GCS_North_America_1983.  This means that the coordinate system is in geographic coordinates using the North American Datum of 1983.

Displaying Streams and Watersheds

Open ArcMap and use the  button to add data. Navigate to the folder where the downloaded data is saved.

We will first add the subbasin and flowlines layers. The NHDflowline.shp shapefile is located in the Hydrography folder and the wbdhu12_a_tx.shp shapefile is located in HydrologicUnits folder.  Please note that in this HydrologicUnits folder I have substituted the Watershed Boundary Dataset HUC12 watersheds for the normal HUC8 watershed files that come with the NHDPlus dataset.  NHDPlus is being updated to include the HUC12 watersheds but that work is not complete yet.

Recolor the themes if you wish. The result is a map similar to the following:

You can see the watersheds that are roughly in the outline of Texas and the NHD stream network that covers Water Resource region 12.

Use File/Save As to save the ArcMap document as Ex2.mxd (to save your own customized colors).

To Be Turned In:  What is the approximate map extent in decimal degrees of these data? Use the Draw Tools in ArcMap to draw lines on the map showing the 100º W Meridian and the 30º N Parallel. Screen capture the resulting map display and include it in your solution.

Selecting the Watersheds in the San Marcos Basin

The HUC12 Watershed, and NHDflowlines feature classes cover a large region and we only want to work in the San Marcos Basin. We'll use ArcMap to identify the San Marcos SubBasin and to create new feature classes using pertinent portions of the feature classes for Region 12.

(1) Turn off the nhdflowline theme in the display, and open the attribute table for the HUC12 watersheds by right clicking on its feature class name:

You’ll see a display that looks like this.  We want all the HUC12 subwatersheds that lie within the San Marcos subbasin, which has a HUC8 value of [HUC_8 = 12100203].

At the bottom of the Attributes table, click on Options and use Select by Attributes

Click on “HUC8”, “=”, Get Unique Values and “12100203” to form the expression

"HUC_8" = '12100203'

In the selection window. Be careful about how you do this since the form of the expression is important.  Once you’ve executed this query, you’ll see that 32 HUC12 subwatersheds  are selected, and if you hit the “Selected” button instead of “All” at the bottom of the Attribute table, you’ll see the selected records, and also their highlighted images in the map.

(2) Make sure that Arc Catalog is closed or the next steps won’t work.  In ArcMap, Right Click on Subbasin and select Data/Export Data to produce a new theme.   If you get a message saying you can’t do this, it means that you haven’t shut down Arc Catalog before trying the data export.  Close Arc Catalog and repeat the export steps if this happens

Browse inside your geodatabase to the Basemap Feature dataset (you’ll have to change the Save as Type to File and Personal Geodatabase feature classes first), name this new feature class as Watershed and save it in the geodatabase as a File and Personal Geodatabase feature class.   Don’t save it as a Shapefile, which is the default option you are first presented with.

You will be prompted to whether add this theme to the Map, click Yes.   In ArcMap, Use Selection/Clear Selected Features to clear the selection you just made.

And then Zoom to Layer to focus in on your selected Watersheds.

Creating a San Marcos Basin Boundary

It is useful to have a single polygon that is the outline of the San Marcos Basin.  To do this, we’ll use the Dissolve Tool in ArcToolbox.  In Arc Toolbox, select the Index tab

and type dissolve in the window at the top of the panel, and select Dissolve (management)

Input Watershed as the Input Features, and name the resulting output feature class Basin.  Click on HUC8 as the Dissolve Field.

You’ll see a new feature class called Basin is created that covers our study area.  Its attribute table has only one record in it, for the HUC basin 12100203:

Use the Symbology properties of the feature classes to make the Watershed and Basin feature classes hollow so that you can see the streams within them:

To Be Turned In:  How many HUC12 subwatersheds are there in the San Marcos Basin?  What is their average area in km2?  What is the total area of HUC12 subwatersheds in this basin in km2?   What is the ratio of the length of the streamlines to the area of the HUC12 subwatersheds (called the drainage density) in km-1?

Selecting the San Marcos Flowlines

Now we can create a layer with just the flowlines in the San Marcos Basin. In ArcMap, use Select/Select by Location to select the features from nhdflowline with their centroid in Basin.

This selects all the flowlines in the San Marcos basin.

Follow the same process to export this data. Save it as Flowline in the BaseMap feature dataset and add it as a layer to the map. Remove the old nhdflowline and wbdhuc12_a_tx themes from your map display, and save the Ex2.mxd file again.

Now lets look at some summary statistics of the flowlines.  Open the Attribute table Right click on the LengthKm field and select Statistics

From this display, you can see the statistics of the LengthKm of the Flowlines.  There are 557 flowlines whose average length is 3.39 km and the total length is 1890 km.  You can do the same query on the Acres attribute of the Watershed feature class to get watershed areas.

To be turned in: How many HUC12 subwatersheds are there in the San Marcos Basin?  What is their average area in acres and in km2?  What is the total area of this basin in km2?   What is the ratio of the length of the streamlines to the area of the HUC12 subwatersheds (called the drainage density) in km-1?

Adding Attributes to the Flowlines

Now we will use the flowline attributes table to symbolize the flowlines based on their mean annual flow. Add the table flowlineattributesflow.dbf to your ArcMap display.

Lets zoom into our Flowlines and use the Inquiry button  in the Tools menu to see the attributes of one of them.  You’ll see there is a number called the COMID that uniquely identifies each flowline feature in the NHD.

If you open the Attributes table of FlowLineAttributesFlow.dbf, you’ll see that it also has a COMID field and lots of tabular attributes that tell you more about the properties of the flowline.  We’ll use COMID as a key field to link the two attribute tables and transfer mean annual flow attributes to the Flowline feature class.

Open the attribute table for the feature class Flowline and select Options/Add Field. You should have Arc Catalog closed while you are doing this or it may not work.

Name the field Mean _Annual_Flow and make it of the type Double.

Now we will join the Flowline layer with the flowlineattributesflow table based on COMID. Right click on the Flowline layer and select Joins and Relates/Join.

Say no to creating an index.

Now when you open the Flowline attribute table you will find the information contained in the flowlineattributesflow table has been joined to the existing features. Scroll over to the column labeled flowlineattributesflow.MAFLOWU. This field contains the Mean Annual Flow for each reach. It is estimated by averaging the mean annual runoff over the drainage area above this reach.

We can set the value of our new field Mean_Annual_Flow by using the field calculator. Scroll back to the column we created, now called Mean_Annual_Flow, and right click on the column label to select the field calculator.

Set this field equal to [flowlineattributesflow.MAFLOWU]. This populates the Mean Annual Flow field with the appropriate value.

Now we can remove the join by right clicking on the Flowline feature class and selecting Joins and Relates/Remove All Joins.

Now our attribute table for SanMarcos_flowlines has a field called Mean_Annual_Flow with the values populated. We can use this field to symbolize the flowlines. Right click on Flowlines and select properties. In the properties menu, select the Symbology tab. Change the Symbology to display graduated symbols for the Mean_Annual_Flow field and hit OK.

The result is a map displaying the relative flow of the streams and rivers in the San Marcos basin.   Use the Inquiry tool to find out the names of the various rivers in the map display.  Use View/Toolbox/Draw to open the Drawing toolbox and select a label:

And add a label to show Plum Creek:

To be turned in: the layout of the San Marcos Basin and streams.  Add labels to show the San Marcos River, the Blanco River and Plum Creek.

Creating a Point Feature Class of Stream Gages

Now you are going to build a new Feature Class yourself of stream gage locations in the San Marcos basin. I have extracted information from the USGS stream gage data books information about 8 gages in this basin:

The location coordinates and flow data can be obtained from the USGS NWIS server, as described subsequently in this exercise.

(a) Define a table containing an ID and the long, lat coordinates of the gages

The coordinate data is in geographic degrees, minutes, & seconds. These values need to be converted to digital degrees, so go ahead and perform that computation for the 8 pairs of longitude and latitude values. This is something that has to be done carefully because any errors in conversions will result in the stations lying well away from the San Marcos basin. I suggest that you prepare an Excel table showing the gage longitude and latitude in degrees, minutes and seconds, convert it to long, lat in decimal degrees using the formula

Decimal Degrees (DD) = Degrees + Min/60 + Seconds/3600

Remember that West Longitude is negative in decimal degrees. Shown below is a table that I created. Be sure to format the columns containing the Longitude and Latitude data in decimal degrees (LongDD and LatDD) so that they explicitly have Number format with 4 decimal places using Excel format procedures.  Note the name of the worksheet that you have stored the data in.  I have called mine Latlong. Save the file as an Excel 97-2003 Workbook or it will not appear in ArcMap. Close Excel before you proceed to ArcMap.

(b) Creating and Projecting a Feature Class of the Gages

(1) Open ArcMap and the Ex2.mxd file you created in the first part of this exercise.  Select the add data button  and navigate to your Excel spreadsheet

Double click on the spreadsheet to identify the individual worksheet within the spreadsheet that you want to add to ArcMap (it’s a coincidence that they have the same name in this example and that is not necessary in general).

Hit Add and your spreadsheet will be added to ArcMap.  Pretty cool!! This is the first time we’ve been able to add worksheets directly in ArcMap.  Before ArcGIS 9.2 we had always to save the worksheet as a .dbf file and add that instead.  ArcGIS 9.3 recognizes Excel 2007 files but ArcGIS 9.2 does not do that, so if you are using ArcGIS 9.2, you will need to save your Excel file in Excel 2003 format.  If you have trouble finding this file in a folder where you know it exists, it can be because your file directory has been labeled Read Only.  In Windows Explorer use File/Properties on your Ex2 folder and turn off the Read Only property and you’ll be able to see the file just fine.

Now we are going to convert the tabular data in the spreadsheet to points in the ArcMap display.

(2)  Right click on the new table, LatLong, and select Display XY Data

(3)  Set the XY Table to latlong, the X Field to LongDD (or Longitude), the Y Field to LatDD (or Latitude), Hit Edit to change the spatial coordinate system, and then Import, and get the coordinate system from the feature dataset Basemap, and you should end up with a display that looks like the one below.

Hit OK, to complete it and you’ll get a warning message about your table not having an ObjectID.  Just hit Ok and move on.  Hit Ok to add the points and voila! Your gage points show up on the map right along the San Marcos River just like they should.  Magic.   I remember the first time I did this I was really thrilled.  This stuff really works.  I can create data points myself!  If you don’t see any points, don’t be dismayed.  Check back at your spreadsheet to make sure that the correct X field and Y field have been selected as the ones that have your data in decimal degrees.

Click on the point symbol under the legend label latlong event and recolor and resize the points so that they show up more clearly.

What you have created is called an “event” which means that it is a graphical display in the ArcMap window of latitude and longitude points that are stored in a table.  It is not a real feature class yet.

(4)  Now, we’ll make a feature class out of the points.   Right click on the latlong Events layer and select Data/Export Data

And export the data into the Basemap feature dataset as the feature class MonitoringPoint.   Say Yes when you are asked if you want to add the points to your map, and now you’ve got a new feature class in the Basemap feature dataset with your points in the same projection as the other features in Basemap (ArcGIS does the map projection automatically as part of the data export process).  Open the Attribute table of the MonitoringPoint feature class so that you can see that all the attributes have been correctly translated from the Excel file.

Open ArcCatalog and check out your Basemap feature dataset.  The MonitoringPoint feature class now resides there.

(5) Save your Ex2.mxd ArcMap document.

Add Attributes to the Point Feature Class

Now we are going to add the USGS gage ID, gage name, and annual discharge for each gage as new attributes in ArcCatalog.

(1) Open ArcCatalog (make sure ArcMap is closed) and navigate to the San Marcos geodatabase that contains your data.

(2) In the Basemap feature dataset, right click on the MonitoringPoint feature class, and click on Properties to open the Feature Class Properties window. Click on the Fields tab and scroll down to the end of the Field Name list. Type the following three entries:

Field Name

Data Type

USGSID

Text

Name

Text

Flow

Double

(3) Click OK and open your ArcMap document ex2.mxd.

Adding Data to the Attribute Table

(1) In ArcMap right click on the MonitoringPoint feature class and open the attribute table. Scroll to the right until you see the new fields you have created. Start editing by selecting Editor/Start Editing.

If the Editing Toolbar is not visible it maybe added by selecting View/Toolbars/Editor.

Select Editor/Start Editing and select the San Marcos geodatabase as the target to be edited:

(2) You may now just add the appropriate data values to the table and for the three attribute fields you added. Continue adding the data values until they are all done.

The following data are needed in the table:

Seq #

Station #

Station Name

Mean Annual Flow (cfs)

1

08170500

San Marcos Rv at San Marcos, TX

176

2

08173000

Plum Ck nr Luling, TX

114

3

08172000

San Marcos Rv at Luling, TX

408

4

08172400

Plum Ck at Lockhart, TX

49

5

08171300

Blanco Rv nr Kyle, TX

165

6

08173500

San Marcos Rv at Ottine, TX

456

7

08172500

Plum Ck nr Lockhart, TX

56

8

08171000

Blanco Rv at Wimberley, TX

142

(3) Select Editor/Stop Editing to finish editing and say Yes when it asks if you would like to save your edits. Note that you can only edit tables for which you have write permission (i.e. your own tables not tables in my work area).

Labeling the Gages in View

Right click on the MonitoringPoint feature class and select Properties. Click on the Labels tab and from the drop down menu select the label field name to be Name.

Right click on the MonitoringPoint feature class again and select “Label Features”. You can now create a view like this:

Pretty awesome!  If you want to move the labels around to customize your map, you can convert the labels to annotation and then they can be individually moved where you want them to be:

Note that in order to move the labels, you have to open the View/Toolbars/Editor and selected the SanMarcos.gdb geodatabase to edit, and the MonitoringPointAnno as the feature class to be edited:

Then, you can move and change the size of the annotation as you wish. When you are done, say Stop Editing and Save your annotation in its new location.  Save the ArcMap document Ex2.mxd also.

Creating a Chart and Layout

(1)          Open ArcMap to create a chart of the mean annual flow of the San Marcos gages. The Mean Annual Flow at the gages is recorded in the column labeled Flow in the attribute table. Open the MonitoringPoint attributes table and make a chart using the tools available in ArcMap. Alternatively, you can export the attribute table to a .dbf file and map the chart in Excel. You can also open the geodatabase tables directly in Excel by using Data/Get External Data and doing a query on the Microsoft Access file that contains the geodatabase. The chart may look something like this

(2) In ArcMap prepare a layout showing a map of the drainage area, the graph of its annual flows at each gage and a table of numerical values describing the gages. You can import your Excel chart and worksheet from the Insert/Object... option in ArcMap.  If necessary resize the original chart or table smaller so that it can be displayed in the layout. You'll see in the chart that the flow in the San Marcos River at Luling and Ottine is much higher than in the upstream stations. That is because of the cumulative effect upstream at Luling and because Plum Creek joins the San Marcos River just upstream of Ottine.

To be turned in: a layout showing the base map, chart and data table for the San Marcos River flows

Overlaying the Edwards Aquifer

The Edwards aquifer is one of the most critical water resources of Central Texas. It is the main source of water supply for San Antonio, the 10th largest city in the United States. The Edwards aquifer is recharged by infiltration from rivers crossing its outcrop area. To determine where the San Marcos River crosses, the outcrop area, I obtained a coverage of the Edwards aquifer from the Texas Natural Resource Information System (http://www.tnris.state.tx.us/)

The Edwards aquifer coverage from TNRIS is in Decimal Degree coordinates. This is the Edwards shapefile that you copied from the zip file at the beginning of the exercise.

(1)          Import your Edwards.shp file into the SanMarcos geodatabase. From the Toolbox window in ArcMap, select Conversion Tools à To Geodatabase à Feature Class to Feature Class.  Although the name of the tool is feature class to feature class, it will also convert a shapefile to feature class.

(2)          Choose Edwards.shp as the Input Features, the Basemap feature dataset of the SanMarcos geodatabase as the output location, Aquifer as the output feature class name, and leave the rest of the inputs as their default values.  Press OK.

This will not only do the conversion from shapefile to feature class, but also add the new feature class to your map.

Right click on the Aquifer feature class and select Properties. Click on its Symbology tab and Label the theme using the attribute Aquifer. This attribute has three values: 1 for outcrop, 2 for downdip and 0 for holes within the outer boundary of the aquifer. Classify the values with Unique Value and color them appropriately.

You'll see that as the San Marcos River flows South East towards the Gulf Coast and it crosses first the outcrop and then the downdip portions of the Edwards aquifer. The downdip region is where the aquifer dips below the land surface and is shielded from the surface rivers by overlying hydrogeological units of low permeability. The Edwards is a fissured limestone aquifer whose fissures lie along its Southwest to Northeast orientation, so its flow moves in that direction, transverse to the direction of flow in the San Marcos basin. It is thus quite possible for water to drain from the San Marcos river into the Edwards aquifer and then reappear as a spring further North in another river. Zoom in to the region where the aquifer crosses the San Marcos basin for a closer look.

To be turned in: Between which two gaging stations does the Edwards aquifer outcrop area occur? What is the difference in mean annual flow at these two gages? Comment on these data. Do they seem correct to you?

Downloading USGS Flow Data

There are also other sources of flow data. One of them is real time data via Internet from the U.S. Geological Survey (http://water.usgs.gov/realtime.html).  This data is taken at the gage sites every 15-60 minutes and is transmitted to the USGS office every 1 to 4 hours. This data relayed using satellite, telephone, and/or radio and can be viewed within minutes on arrival to the office.   Notice the difference between the flow conditions in September 2002 to 2009.  In 2002, the Northeast was experiencing a severe drought while in 2006 it was wetter than normal, in 2008, we had Hurricane Ike in Texas, and today there is a severe drought conditions in Texas. Hydrology is a wonderful phenomenon – always changing!

You can see the effect on streamflow of Hurricane Ike which passed through this region Sept 12-15, 2008!

(1) Click on the site: http://waterdata.usgs.gov/nwis/rt

(2) Once you have looked around a bit click on Texas on the map of the United States located above. This link will bring you to a web page, which shows real time data for the state of Texas. Click on a gage shown on the map to display a graph.  It’s a bit hard to select stations on this map since you can’t zoom into Texas, but you can see the station name on the bar at the bottom of your web browser.  The San Marcos River at Luling, Texas is station 08172000.

To be turned in: The graph of flow of the San Marcos River at Luling printed from the NWIS website.   What are the 20%, 50%, and 80% cumulative probability flows for the calendar day on which you do the download?  Approximately what % cumulative probability is the flow currently?

Summary of Items to be Turned in:

1.  What is the approximate map extent in decimal degrees of these data? Use the Draw Tools in ArcMap to draw lines on the map showing the 100º W Meridian and the 30º N Parallel. Screen capture the resulting map display and include it in your solution.

2. How many HUC12 subwatersheds are there in the San Marcos Basin?  What is their average area in km2?  What is the total area of HUC12 subwatersheds in this basin in km2?   What is the ratio of the length of the streamlines to the area of the HUC12 subwatersheds (called the drainage density) in km-1?

3. A layout of the San Marcos Basin and streams.  Add labels to show the San Marcos River, the Blanco River and Plum Creek.

4. A layout showing the base map, chart and data table for the San Marcos River flows.

5. Between which two gaging stations does the Edwards aquifer outcrop area occur? What is the difference in mean annual flow at these two gages? Comment on these data. Do they seem correct to you?

6. The graph of flow of the San Marcos River at Cuero printed from the NWIS website.   What are the 20%, 50%, and 80% cumulative probability flows for the calendar day on which you do the download?  Approximately what % cumulative probability is the flow currently?