Collaborating with the Stroud Water Research Center and other partners, the Azavea Civic Apps team recently completed new versions of two web applications, Model My Watershed and Micro Site Runoff Model.
These two web applications support collaborative planning and design of freshwater systems between citizens, conservation practitioners, municipal decision-makers, educators, and students. They are both part of a larger project, known as WikiWatershed.
What is Model My Watershed?
Model My Watershed is a web application that enables users to combine a number of data sets, including land cover and soil type, to compute stormwater runoff for an area of interest. The app calculates stormwater runoff and water-quality impacts using professional-grade models and compares potential conservation or development scenarios to existing land use.
Model My Watershed application interface with area of interest selected by school district boundary and land cover analysis results in sidebar
Integrating a Tested Product
Apart from the obvious impact for local and regional planning, we wanted to have a fast, responsive application. The app utilizes nationwide data as the source for the model calculations, and data sets this large can slow calculation speeds to a snail’s pace. To overcome this obstacle, the project team used Azavea’s GeoTrellis, proejct, a software toolkit for making fast calculations on large data sets. GeoTrellis was used at two stages of the project in order to improve the speed of raster processing during on-demand model calculations.
Model My Watershed runs calculations on specific areas of interest: a watershed, a town, or a neighborhood selected by the user. In order to make these calculations feasible, the team used GeoTrellis to first divide the large national data set into smaller “tiles” organized like a grid across the country. By using the Apache Spark clustering built into GeoTrellis to distribute data across many machines, the team was able to process the data as a large batch for fairly large set of data.
The processed images were uploaded to the Amazon Simple Storage Service (S3) and prepared for use GeoTrellis using Amazon Elastic MapReduce, a service designed to distribute many smaller tasks across many machines.
Real Time Calculations
While it was essential to batch process the nationwide data in advance, that was not the only use of GeoTrellis in this application. The team also used Celery in order manage the workflow of the stormwater runoff models. Celery is an asynchronous workflow management tool that enables software engineers to develop a task queue for real-time processing operations. A Celery workflow integrated GeoTrellis and enabled the application to models in real-time based on the user input.
Model My Watershed: Compare view displaying stormwater runoff calculations of minimal development scenario vs. current scenario vs. modified scenario
In addition to defining an area of interest, the application user can also define different land use types or test the impact of a land conservation measure, such as a green roof, by drawing a polygon or entering an acreage. The model accounts for the change by totaling the count of each land use type for the study area, clipping the user input area to the study area boundary, and counting the total change for each cell type. This on-demand calculation also uses GeoTrellis for processing.
Background on the Models
Site Storm Model
The Model My Watershed application uses two different models for estimating stormwater runoff: TR-55 and MapShed. The U.S. Department of Agriculture Natural Resources Conservation Service (NRCS) published a Technical Release titled “Urban Hydrology for Small Watersheds” in 1986. The procedures included in Technical Release 55 (TR-55) include storm runoff volume and peak rate of discharge calculations. These calculations are still widely used today.
In addition to hydrology calculations, the model was extended to provide “event mean concentrations” based on water quality measures. These are essentially pollution loads in given an amount of runoff. The project team wrote modified versions of the TR 55 calculations in Python and applied them to the what is called the “Site Storm Model” in Model My Watershed.
Watershed Multi-Year Model
MapShed is desktop tool developed by Dr. Barry Evans, a research faculty member at Penn State University and Adjunct Science Faculty at the Stroud Water Research Center. MapShed models sediment and nutrient transport within a watershed using hydrology, land cover, soils, topography, weather, pollutant discharges, and other critical environmental data.
Because the original MapShed model was developed for off-line use on a research workstation, in order to use it in a web application it was necessary to re-write and re-architect more than 17,000 lines of MapShed code, written in Visual Basic, to Python. The models defined in MapShed were adapted for the Model My Watershed app with the help of Dr. Evans. These calculations are referred to as the “Watershed Multi-Year Model” in the app.
A unique file type, called
.GMS, was created as part of the MapShed project as a way to define a broad array of model paramters. A
.GMS is a type of comma-separated value file, but is different from
.CSVhas defined number of columns, where the values between commas are row values.
.GMSdoes not have a defined number of columns and has a different number of comma-separated values in each row.
.GMS was incorporated into Model My Watershed as an export option so that users can begin project work in Model My Watershed and continue in MapShed, allowing for more advanced usage.
What is the Micro Site Runoff Model?
The Micro Site Runoff Model is aimed at helping people learn the basic mechanics of stormwater modeling It is an interactive animation of the results of a 24-hour storm event for one location. The interface is designed to show levels precipitation, evapotranspiration, runoff, and infiltration based on land cover and soil types.
Results of different land cover classes on precipitation distribution for 24-hour storm events
A user chooses the amount of precipitation using a slider bar and selects a land-cover and soil type. The model instantly depicts the results of the selections as an animation.
Overall, the team was able to create applications that enable users to answer complex questions. Integrating GeoTrellis made extremely fast tile counts possible, which are essential to the model functionality. The team was also able to incorporate modified versions of existing models by carefully porting thousands of lines of VB to Python. In addition, the two apps showcase different designs to encourage users with different levels of watershed knowledge to access the data.
To learn more about the architecture, development, and design of Model My Watershed, look out for future posts about technical topics.
How can we help your team accomplish its goals in designing a web app? Let us know what you’re trying to achieve.
Want to work on projects with a social and civic impact? Sign up for job alerts.
Want to work on projects with a social and civic impact? We’re hiring.