Considerations for Interacting with HSPF in ArcGIS
Nathan Johnson, CRWR
Table of Contents
The Hydrological Simulation Program - FORTRAN (HSPF) is a set of computer codes that can simulate the hydrologic, and associated water quality, processes on pervious and impervious land surfaces and in streams and well-mixed impoundments. (HSPF Version 12 Users Manual) WinHSPF is a program developed for the EPA by AQUA TERRA Consultants in Decatur, GA and distributed with the EPA's BASINS software. WinHSPF provides a windows-based interface to the extensive input data for HSPF.
A system of preprocessing data for HSPF was present in the BASINS interface which operated within the ArcView 3.x software which worked closely with WinHSPF to develop and post-process HSPF water quality models. Much of the geospatial preprocessing functionality of BASINS is dependent on the ArcView 3.x environment and consequently not available with the most recent ESRI ArcGIS software.
The new ESRI ArcGIS software (Arc8.x and Arc9.x) have a file format built around a relational database called a Geodatabase. The intent of investigating a database interface to HSPF is to provide a intuitive, easy-to-interact-with way to manipulate the data for HSPF using tools from ArcGIS. The input file for HSPF is a large text file with very specific formatting requirements making it cumbersome to manipulate and very easy to make mistakes. Timeseries used in HSPF are most often stored in a Watershed Data Management (.wdm) file. The .wdm file is in a binary format, and difficult to work with without extensive knowledge of its structure. However, much of the work to read from and write to .uci and .wdm files has already been done with the Visual Basic code behind WinHSPF and other BASINS software (GenScn and WDMUtil).
The goals of the project are to provide a framework (and eventually an implementation) for the transfer of data from a geodatabase to the .uci and .wdm files, and the other direction, from the .uci and .wdm files to a database. Using the public domain Visual Basic Code which supports WinHSPF and other code distributed with BASINS (GenScn and WDMUtil) it is possible to develop custom interfaces for interacting with .uci and .wdm files using ArcGIS applications.
Bexar Region Watershed Management Coalition's plan
The San Antonio River Authority, in partnership with Bexar County and the City of San Antonio, is developing a Regional Watershed Management Plan. Initial work under this partnership focused on flood control, and work is now beginning to be started on the water quality aspects of the Watershed Management Plan. The Arc Hydro Data Model, which is implemented in ArcGIS as a geodatabase, is being used to organize data for the San Antonio River Watershed. HSPF has been chosen as the water quality model for San Antonio's Regional Watershed Management plan and consequently tools to interface between a geodatabase and HSPF are needed.
The goal of the water quality modeling component in Bexar County's Watershed Management Plan is to support the development of HSPF models under different scenarios which could affect water quality. Figure 1 outlines the workflow of the current water quality part of the plan. Data from the Arc Hydro Geodatabase will be used to create calibrated hydrologic models for each watershed (process shown in blue). The calibrated models will be stored in the geodatabase and when changes or developments are proposed, ArcGIS and BASINS tools will be used to investigate how these changes will affect water quality (process shown in green).
Figure 1 Water quality workflow for Bexar County.
Arc Hydro, HSPF, and BASINS tools
The BASINS team members at AQUA TERRA Consultants are currently working on developing a BASINS toolbar (BASINS4) which will be available in the ArcMap environment. This toolbar will eventually allow users to access all the functionality of the old BASINS software in ArcGIS. BASINS is undergoing a major overhaul before the release of BASINS4 with the goal of separating those components of BASINS which do not depend on GIS applications from the GIS environment.
BASINS currently provides tools for preprocessing data for HSPF models in the ArcView 3.x environment. Much work has been done at the Center for Research and Water Resources which parallels the BASINS' HSPF preprocessing. Tools have been developed in ArcGIS (and are available in the Arc Hydro Toolbar) which define streams, delineate subbasins, define connectivity, calculate centroids, and perform many other common hydrologic calculations. Some effort is being directed to investigating the possibility of using Arc Hydro tools to preprocess data for building an HSPF model. Once a .uci file has been developed and calibrated using WinHSPF, tools could be developed (using the code behind WinHSPF) to create an interface between ArcGIS and the .uci file .
CRWR has been collaborating with the BASINS team at AQUA TERRA Consultants to develop tools to integrate the Arc Hydro model for timeseries into the BASINS tools associated with GenScn. GenScn contains tools to plot timeseries output from HSPF and to link the geospatial data used to build the HSPF model to those timeseries.

Figure 2 Arc Hydro timeseries will be available for plotting in GenScn.
GenScn currently contains the capabilities to read in several types of data including .wdm, SWATDBF, HSPF Binary, and HSPF Output. Using an abstract Visual Basic timeseries class, the code behind GenScn stores all data in a format which GenScn can plot, export, summarize, and manipulate. The initial goal of interacting with HSPF through ArcGIS is to add the capability for GenScn to plot timeseries stored in an Arc Hydro format (Figure 2). Additionally, the Visual Basic code behind GenScn could allow timeseries output from an HSPF model to be converted to the Arc Hydro format. With HSPF timeseries data in the Arc Hydro format, tools developed at CRWR could then be used for plotting and manipulating data in the ArcGIS environment.
Once Timeseries can be transferred from .wdm to Arc Hydro format, work will focus on developing tools to interact with the .uci file for HSPF through ArcGIS. Initial efforts at CRWR focused on developing a comprehensive database representation of the HSPF .uci file, however, much of the work of constructing this structure has already been done by the BASINS team in the code behind WinHSPF. The existing structure and the tools present in WinHSPF could make it relatively easy to develop tools to interact with ArcGIS. Common changes to a watershed such as landuse changes, additional gauging stations, channel improvements, or BMP's could be processed with ArcGIS. These changes could then be applied to an existing HSPF model with tools developed using the code behind WinHSPF.
To avoid duplicating efforts, another goal of Bexar County's water quality project is to develop a system for utilizing as much of the existing data for hydrologic and hydraulic modeling as possible. Much work goes into developing cross sections for hydraulic modeling with HEC-RAS, and those cross sections and profile lines could be used to build channel descriptions for HSPF. It is also possible that the subbasins delineated for hydrologic modeling could also be applied for HSPF modeling, however different segmentation will probably be necessary.
A pilot study as a proof of concept is planned for Cibolo Creek, a watershed Northeast of San Antonio. There are existing Hydrologic and Hydraulic models for Cibolo Creek and it is listed on Texas' 303(d) list and is a target for TMDL study in the next year or two.
This page was created by:
Nathan Johnson
Center for Research in Water Resources
The University of Texas at Austin
njohnson@mail.utexas.edu
https://webspace.utexas.edu/nwj58/index.html
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 2004 Center for Research in Water Resources.