An ArcView GIS tool for SWMM

An Arc View GIS (geographic information system) interface has been created for viewing and facilitating development of USEPA SWMr\r1 RUNOFF and EXTRAN models. The interface is a group of A venue scripts that allow users to visualize a SWMM model in conjunction with existing GIS data. (Avenue is a programming language bundled with ArcView.) The rationale for using Avenue/ArcView as a platform for a SWM,_\1 GIS tool has been previously presented by Shamsi (1998). The scripts have been published as freeware, allowing easy access for other SWMM modelers and offering users the oppmiunity to make their own enhancements, similar to the communal efforts that have characterized SWMM advancements over the years. The scripts permit viewing of model input and output summary data \J¥1.thin Arc View, allowing modelers to exploit GIS tools for analyzing model configurations and output. They do not substitute for existing commercial software interfaces for SWMM, as they do not permit viewing of conduit profiles, dynamic display of results, or editing of input data. Arc View's strengths do not lie in display of three-dimensional or dynamic data, so it would be cumbersome to develop such tools within Arc View.


Introduction
One of the fundamental strengths of SWMM (US EPA Stonn Water Management Model; Huber and Dickinson, 1988;Roesner et al., 1988) has been its open source code and free distribution.However, the cost-free program alone has limited application in contemporary settings where graphical user interfaces (GUls) define the norm for nearly all computer applications, and geographic information systems (GIS) are linked with most geographically-based models.This limitation ofSWMM has led to the development of numerous commercial interfaces for the program such as XP-SWMM and MikeSWMM and has contributed to its decline in popularity relative to models that have integrated GUIs such as MOUSE and Hydroworks.Other efforts have been made to develop low cost GUIs and GIS for SWMM such as Windows SWMM (see e.g.Huber, 2000) or PCSWM.\1/PCSWMM-GIS(Computational Hydraulics International, 2000).
Many stonnwater modelers use a suite of models and interfaces to solve different problems.A typical model development project may involve software for databases, spreadsheets, CAD, GIS, and text editing, as wen as one or more SWMM-specific tools.Since GIS has become an integral part of much infrastructure analysis and mapping in the last few years, many stonnwater modelers have incorporated GIS into their repertoire of modeling tools.Since many stormwater modeling functions can be facilitated by GIS, tools that work within a widely used GIS can be a valuable component of a modeler's toolbox (Haubner and Joeres, 1996).This approach was taken by Curtis (1994), who developed an interface for SWMM within ArcInfo GIS, and by DHI (Danish Hydraulic Institute) in its MouseGIS (DHI, 1999), which provides selected preand post-processing functions for MOUSE and EXTRAN within ArcView.Other ArcView extensions have been developed by ESRl (Environmental Systems Research Institute, Redlands, California) and CEDRA (CEDRA Corporation, Rochester, New York).ESltl distributes AVRas, an ArcView extension for the US Anny Corps of Engineers HEC-2 open-channel hydraulic model (ESRI, 1998).CEDRA sells AVSAND, one of a suite of ArcView extensions for cataloging and viewing infrastructure data, including collection systems (Tomas and Tonias, 1995).
ArcView is one of the most widely used GIS tools in infrastmcture management (ESRI, 1999).It has a relatively low cost, and can share data with ESRI's high-end ArcInfo software, as well as with its ArcExplorer freeware.Arc View has also built a large and active user base because of its bundled programming language Avenue, which allows users to develop custom tools within the ArcView enviromnent.Avenue is an object-oriented programming language, and its scripts are generally saved as text within Arc View files.Much of the ArcView program is written in Avenue.Users can explore and extend the program's functionality by viewing and editing the many scripts built into the program.Additionally, many scripts written by Arc View users worldwide are freely distributed through ESRl's World Wide Web site (ESRI, 2000).
The free and open nature of ArcView scripts echo the development of SWMM over the years.Since its creation for EPA in the early 1970s, SWMM has been open for users to modify as they wish.Users who added a feature for their own purposes and then made the new feature available to the user community have been responsible for many improvements to SWMM.
In that spirit, this chapter introduces SWMMTools.a group of open and extensible GIS scripts for SWMM developed within ArcView.SWMMTools permits viewing of model input and output summary data within ArcView, allowing modelers to exploit GIS tools for analyzing model configurations and output.SWMMTools does not substitute for the commercial interfaces for SWMM, as none of the scripts permits viewing of conduit profiles, display of dynamic results, or editing of input data.The scripts are designed to facilitate modeling for engineers who have access to other SWMM visualization tools.However, provided they have access to Arc View, SWMMTools also provides a basic GIS interface for SWMM for users who might othenvise only use the core SWMM program.The SWMMTools extension is available from the ESRI ArcScripts webpage (http://gis.esri.com/arcscripts/scripts.cfm, keyword SWMM).A link to the webpage is posted on the Oregon State University SWMM webpage (http://www.ccee.orst.edu/swmm).
The six scripts work with standard SWMM 4.4 input and output files and function in metric and English units.The entire package has been assembled into an Arc View extension that adds a single pull-down menu to Arc View.The first script loads a plan view ofaRUNOFF conduit network and optionally links RUNOFF catchment data to an existing GIS theme.The second script loads a plan view of an EXTRAN junction/conduit network.The third and fourth link RUNOFF and EXTRAN summary output with RUNOFF and EXTRAN GIS themes respectively.The remaining two scripts work with a stormwater catchment theme to facilitate catchment parameterization.The fifth script estimates RUNOFF catchment widths.The sixth script estimates RUNOFF effective imperviousness (parameter DCIA) from GIS land use data.
The ArcView extension has been used to facilitate development and presentation of several SWMM models.In Ho Chi Minh City, Vietnam, the extension was used to facilitate development of a combined sewer model where minimal field data were available beyond a detailed map of the study area.The scripts facilitated development and display of both the RUNOFF and EXTRAN models.Flooding volumes from EXTRAN were mapped in the GIS and proposed drainage system improvements were presented as change maps showing existing and improved flood volumes at model junctions.

Overview of Functions
Shamsi (1998) catalogued the functions that a GIS program could facilitate for SVlMM modeling.As SWMM' s capabilities cover a wide array of applications, a comprehensive interface for the program is very complex to build.SWMMTools does not attempt to provide a comprehensive environment for SWMM.That is the domain of commercial products such as XP-SWMM, PCSWMM, and MikeSWMM (see e.g.Huber 2000;Shamsi, 1997).SWMMTools exploits the strengths of ArcView, which lie in the visual display of static, plan view, geographic data.
SWMMTools was developed for typical urban stormwater applications of SWMM.The scripts thus focus on viewing input and output files for SWMM's RlJNOFF and EXTRAN modules (or "blocks"), which provide the core functionality for analyzing urban sewer systems.Additional functions facilitate the transfer of GIS catchment data to the RUNOFF module and aid in estimation of area, effective imperviousness, and overland flow widths within RUNOFF.The scripts are collected into an Arc View extension that appears as a pull-down menu within the ArcView View window (Figure 11.1).The six main scripts serve the following fimctions: • Read/Display RUNOFF input SWMM's output data formats remain rooted in its 1970s origins.It produces extensive tabular output that the user can review to evaluate model and system performance.In the days when each model simulation was set up with care and run overnight, most modelers made the effort to review each model output file thoroughly.Today however, cheap computing makes errors in any individual simulation less criticaL This factor, combined with the much larger size of many of to day's models, often relegates summary output to a cursory review at best.By linking this data to a GIS and loading it into a queryable data table, SWMMTools makes the summary output much more accessible.The thematic mapping strengths of Arc View greatly facilitate analysis of SWMM summary output.

Design Considerations
Software design must consider a spectrum of end-user issues, such as menu layout, filing systems, and user assistance (Cooper, 1995).Software developers must further consider development issues such as programming language, development tools, and internal documentation.Furthennore, cost is the driving force in many software design decisions.SWMMTools was developed as an aid to project consulting work performed by the author.It was generally designed using the most expedient method available.Thus, Arc View's Dialog Designer development tool was not used to create the input dialogs, although it can produce a better interface.Scripts that use the Dialog Designer's eventdtiven interface are much more complicated to build and modify than those that use the more traditional command-driven approach.
The scripts do not consistently adhere to good software design principles.There are stylistic differences among modules, hard-wiring of parameters and file names, and inadequate opportunities to cancel incomplete operations.However, SWMMToois possesses the virtue of relative simplicity.Since Avenue is bundled into ArcView, a moderately ambitious user can modifY the scripts to be more flexible or to meet hislher specific needs.The Arc View command Script I Load System Script permits the user to review and modifY the code for any unencrypted portion of the program, including third-party extensions such as SWMMTools.(To view one of the scripts, double-click Scripts from the Arc View Project window to create a new script.Next, select Script I Load System Script.Finally, scroll to one of the SWMt\1.XXX scripts from the dialog box.) The sClipts have been designed to work with SWMM4.4 input and output files and ArcView 3. As SWMM continues to evolve, its input and output formats will continue to be modified.As such, the scripts will likely require modifications to work with future SWMM versions.Most modifications to SWMM's fonnats over the years have been incremental, and thus it should be possible to adapt the scripts to future SWMM versions with only minor code revisions.Changes to ArcView pose a much greater barrier, as ESRI has announced that it is phasing Avenue out in favor ofV isual Basic for Applications (VBA).At the same time, future versions of ArcView will be scaled-down versions of ESIU's high-end Arclnfo software, rather than an independent platfonn.The current Arc View environment and its Avenue scripting language thus have arclatively limited future.While the SWMMTools scripts will not be useful once the Arc View 3 environment becomes obsolete, their algorithms could provide the basis for implementation of similar tools developed with VBA.

SWMM -GIS Integration Issues
Linking EXTRAN to a GIS is easy, as an EXTRAN input file describes a link -node conduit network.The only core GIS information lacking from a standard EXTRAN input file is spatial coordinates.Others have addressed this problem previously, and two standards for obtaining coordinate data have been incorporated into the scripts.SWMMTools allows coordinate data to either be read directly from the junction data (D 1 line ), as in SWMM4.4 and MikeSWMM, or to be read from an extemal file using MTVE fonnat (TenBroek and Roesner, 1993;10 Brooks Software, 1997).When combined with coordinate data, an EXTRAN input file thus contains sufficient data to build GIS themes displaying the conduits, junctions, and other elements of an EXTRAt"f model.This approach does not account for curved conduits, but a conduit theme could be edited within ArcView to achieve this.
Displaying a RUNOFF model in GIS is more complex.For this application, RlJNOFF data are assumed to consist of conduit (G 1 gutter) and catchment (HI) descriptions.Neither contains any geographical infonnation within a standard RUNOFF file.Displaying RUNOFF conduits is further complicated by its link-inlet configuration.RUNOFF is not a link-node model as EXTRAN is.A RUNOFF conduit connects directly to another conduit at its dOV'lllstream end (unless it is at the downstream limit of the model).This problem was addressed by requiring a separate MTVE-fomlat coordinate file for locating nodes in RUNOFF.RUNOFF catchments are polygons that require many coordinate pairs for a full description.SWMMTools optionally links the catchment data to an existing GIS theme created independently of SWMM.

Display of RUNOFF Data
Two types of RUNOFF input data are read by SWMMTools: catchment (HI) and conduit (G 1 gutter) data.In order to display conduit data, the user must create a coordinate file that defines each inlet location identified in the catchment and conduit data (parameter NGTO in both the G1 and HI data groups).The coordinate file uses the same fonnat as the XYS file format used by MTVE (a space-delimited ASCII file).When the user supplies a RUNOFF input file name and a corresponding coordinate file, SWMMTools creates hvo GIS themes: RunoffMI-I and Gutters.RunoffMH is a point theme with one point for each inlet specified in the catchment and conduit data.Gutters is a line theme containing each G 1 conduit and its associated data.
The user can optionally specify an existing catchment theme that must be active in the current view.If a catchment theme is identified, SWMMTools links the RUNOFF catchment data to the theme.An additional line theme is also created that connects the centroid of each catchment to its corresponding inlet (the Channels themc).The Channels theme provides a useful visual check of the distance between a catchment and its inlet, prov"iding an additional input file debugging aid.In most cases, the displayed channel should be located \vithin the limits of its associated catchment, or extend a short way beyond its border.A chamlel that extends across other catchments may be associated with an incorrect inlet.
Whether or not a catchment theme is identified, the program creates a data table for the catchment (catchmnt.dbf).In the case where no catchment theme is identified, it would be problematic to associate catchment data with inlet locations, as multiple catchments could be associated with a single inlet.
In addition to loading the input data, SWMMTools also creates a field containing pipe dimensions as displayable text (WH, an abbreviation of Width by Height).Box culverts dimensions are represented as width x height, permitting creation of a thematic map that closely resembles a typical sewer map.The Avenue algorithm converts English pipe dimensions from feet to inches and metric dimensions from meters to millimeters.
SWMMTools reads RUNOFF summary output data from a standard SWMM output file if RUNOFF input themes have been previously defined.Summary conduit data, such as peak flow and surcharge duration, is read and associated with the Gutters theme via an ArcView Join operation.Summary catchment data, such as total runoff and peak runoff, are read into a data table and optionally joined with an existing catchment theme.

Display of EXTRAN Data
SWMMTools reads conduit (Cl ),junction (D 1), orifice (Fl), weir (G 1), pump (HI), and outfall (Il/I2) data from EXTRAN input files.Geographic referencing of junctions is obtained either from the junction data (as in MikeSWMM and SWMM4.4) or from an MTVE-format coordinates file.Two GIS themes are created: Manholes and Pipes.The Pipes theme contains data from the C 1 group as well as from the orifice, weir, and pump groups.While EXTRAN uses pipe type codes from 1 to 12, non-conduit elements are assigned pipe types 21 and higher in the Pipes theme.In a similar manner, the Manholes theme contains a field for outfall type, with normal manholes assigned a value ofO, and outfalls assigned either a 1 or a 2 (ungated and gated, respectively).As with RUNOFF data, SWMMTools automatically computes a dimension label field (WH).
SWMMTools cannot display a horizontal profile of a pipe network.ArcView's ability to work with this type ofthree-dimensional data is limited, even with the ESRI Spatial Analyst extension.This capability is found in AVSAr,,'D, a commercial ArcView extension publishcd by CEDRA Corporation.Development of a profiling tool was not pursued for SWMMTools, as the existiug interface programs for SWMtvI already perform this function well.
SWMMTools reads EXTRAN summary output data from a standard SWMM output file.Summary output is joined to existing Manhole and Pipe themes, along v.ithjunction outflow (outfalliflooding) volumes.As in RUN-OFF, the EXTRAN summary tables contain useful information that is often overlooked.Junction summary data read by SWMMTools include duration of surcharge, average percent change, and duration of flooding.Conduit summary data read by the program include maximum flowrate, maximum velocity, and ratio of maximunl flowrate to design flowrate.SWMtviToois could be easily modified to include additional summary columns from SWMM output.

RUNOFF Model Development Aids
Two scripts in SWMMTools do not work directly with SvVMM input or output files.These scripts are aids for developing RUNOFF catchment data.One script (Update Basin Areas) computes catchment areas in either acres or hectares (as required by RUNOFF) and estimates the RUNOFF catchment width parameter.The remaining script computes DCIA for a catchment theme that has previously been unioned to a land use theme using the ArcView Geoprocessing Wizard.
The Update Basin Areas script primarily performs a housekeeping activity.While Arc View can compute the area of each catchment (polygon) within a polygon theme and store the values in a data table, it does not automatically update the data table as the theme is edited.The Update script creates andlor updates either an Acres or Hectares field based on the appropriate project units.This script is derived in part from a sample script included in the ArcView sample files (calcapLave).
In addition to computing the area, the Update script estimates catchment width.Catchment width is a measure of the length ofthe main drainage channel in a catchment and the level of aggregation of the prototype drainage net\vork.In many situations, this parameter is considered primarily a calibration parameter.The algorithm used computes the catchment width as 1.7 times the longer ofthe height or width ofthe catchment polygon.This approach is loosely based upon a methodology in the SWMM manual (Huber and Dickinson, 1988), which suggested an initial catchment width of 1.7 times the length of the main drainage channel.As Arc View only computes the axis lengths of a polygon along the Xand Y-axes, the polygon extent does not necessarily correspond with the length of the principal axis.However, the method yields a reasonable value for a typical model, and is intended as an initial estimate rather than a fixed specification.It could be easily modified to use the root mean square of the catchment's a.xis lengths or the catchment's perimeter.
The DCJA script performs a series of database calculations to compute the average DCIA (effective imperviousness) within each catchment in a catchment theme.It requires that the user first union a catchment theme with a land use theme to produce a theme that divides each catchment into sub-catchments corresponding with each land use in the catchment.The script then re-merges the sub-catchments into the original catchments while computing an areaweighted mean DClA.The script reads land use types and associated imperviousness fractions from a separate land use data table (.dbf format) in order to perform the aggregating calculations.

SWMMTools Application
lnHo Chi Minh City, Vietnam,SWMMToolsfacilitateddevelopmentofamodel of the Nhieu Loc -Thi Nghe tidal canal and combined sewer system.Integration ofSWMM with Arc View helped lower the language barrier between expatriate consultants developing the model and city engineers whose first-hand knowledge often provided the only reliable infOlmation on the system.Figure 11.2 shows the EXTRAl"'{ conduit network for the Nhieu Loc -Thi Nghe basin coded by pipe type.The figure shows that the drainage system is a mix of closed conduits and open channels.The closed conduit system has three major components depending on its age.In the downtown, the brick arch sewers date to the French colonial administration in the 1920s.Sewers in the outlying areas are generally circular reinforced concrete pipes built with United States assistance as the city expanded rapidly during the 1960s.As the city has continued to grow in recent decades, the Vietnamese government has built box culverts to relieve failing older sewers and to cover polluted canals.Viewing the pipe network in Arc View permitted the engineering team to examine the system fi'om a large-scale perspective such as shown in the figure; as wen as to focus on individual streets and canal reaches.

Conclusions
The author hopes that S\VM}.1Toolsopens a new avenue ofSWMM development.The Arc View extension should expand and facilitate S\\'MM modeling capabilities for stormwater modelers who also utilize GIS in their work.The tool supplements rather than replaces the existing commercial interfaces for SWMM, as it only operates within the ArcView environment, \vhich has advantages as well as numerous drawbacks relative to custom software.SWMMTools contributes to the evolution ofSWMM by giving it an open visual interface.As S\VMM' s interfaces are improved, the model itselfbecomes more useful, further ensuring it'> continued utility.
The simple RUNOFF development tools within SWMMTools are adequate for many purposes, as RUNOFF modeling generally requires less analysis of sewer profiles or dynamic results than EXTRAN modeling.ArcView with SWMMTools can greatly facilitate the development of simple RUNOFF models.
Among the advantages of adding a freeware visual interface to SWMM is enhanced opportunity for public involvement in modeling studies.The use of SWMM and SWMMTools facilitates public review of model results when compared with the use of a costly proprietary model that interested parties may not be able to afford.In this manner, low-cost and no-cost model visualization software facilitates review and foster dialog among engineers and the community.Since Arc View is widely used and ESRI's ArcExplorer freeware can read data developed in Arc View, models and results developed using SWMMTools can be viewed by a wide variety of users who do not need to perfonn simulations but are interested in viewing model configurations and output.This includes community groups, graphic artists assisting in report preparation, and consultants reviewing model results.

Figure 11 .
Figure 11.3 shows the difference in street flooding volumes for a two-year storm for existing conditions and following a proposed improvement program.The figure was developed using SWMMTools to read flood volumes from two EXTRAN simulations.The figure demonstrates SWMMTools' principal strength: facilitating transfer of modeling data into a geo-referenced database.Other post•-processing programs for SWMM also transfer model results to databases, but their customized interfaces are generally less flexible in allowing the range of ad-hoc queries that can be implemented within ArcView.

Figure 11
Figure 11.4 RUNOFF Channels theme showing catchment centroids and inlets.