A Web Based Interface for Distributed Short-Term Soil Moisture Forecasts

Agricultural non-point source (NPS) pollution is a source of water quality impairment, and demonstrates widely varying spatial and temporal pollution potential. Many efforts to protect water quality are based on seasonal and annual estimates of pollutant loss potential (NRCS 590 nutrient management standard, P-Index) that inadequately address the hydrologic processes driving NPS pollution. One barrier to adopting practices that address NPS pollution is a lack of tools capable of transferring information at sufficient spatial and temporal resolution so that end-users can make informed decisions. We introduce a web-based system displaying distributed hydrologic forecasts using free and open source software. The system consists of three primary components: (1) a hydrology model that provides short-term distributed forecasts; (2) a data structure capable of re-structuring large, high resolution rasters; (3) an interface employing adaptive map-viewing technology that allows end-users to interact with the data to avoid high-risk areas when planning agricultural practices.


Introduction
Non-point source (NPS) pollution from agricultural lands is a major source of impairment to surface waters in the United States [1].Various government agencies have introduced standards and tools (e.g., NRCS 590 Standard, P-Index) in an effort reduce to NPS pollution; however, these standards and tools have mixed success in reducing NPS pollution [2][3][4].While there are many causes for this, one major limitation is a lack of success in communicating information pertinent to planning land management activities in a manner which can both reduce NPS pollution and increase agricultural management flexibility [5].Tools such as the P-Index, which are generally annual and developed at a field level resolution, may fail to provide information at a high enough spatial and temporal resolution to consistently allow targeted landscape management [6,7], and effective communicateation of results remains a challenge [5].In the land management community, there is a gap between the predictive ability of models and how that information is delivered to end users [8].Effectively communicating when and where critical source areas form could be used to further optimize agricultural nutrient management operations [9].
Real time decision support systems (DSS) are an effective approach used to disseminate information by leveraging internet connected devices to directly deliver relevant information to end users [10,11].In order to provide variable source area (VSA) forecasts to a large audience of end users, and tools to interested scientist developing solutions to similar problems, this study introduces a DSS that provides real-time and spatially detailed, short-term forecasts in a web based interface built on free and open source software (FOSS).Although DSS platforms with similar goals have been introduced (e.g., predicting stream flow or reservoir status [12][13][14][15]) and software tools have been designed to communicate geospatial information including real time data and forecasts from earth systems models [16][17][18] we describe a system that is developed for the particular problem of rapid refresh, high resolution, forecast products capable of displaying raster model outputs anywhere in the world at very fine resolutions.

Design Requirements
This system is intended to be used by agricultural producers, conservation personnel, or agricultural extension personnel to better plan potentially polluting farm activities, such as manure application, prior to a precipitation event or on saturated soils (VSAs).A producer using the DSS could reschedule the time or location of an application based on the forecast to a day or area where less of the field is saturated, thus avoiding water quality degradation.Users of this system need to make sub-field level decisions on a day-to-day basis, thus, outputs of the system need to be "sub-field-scale" spatial resolution and update sub-daily to allow flexibility in timing.A number of studies aimed at describing watershed processes mention a raster cell size between 2.5 and 25 m as sub-field-scale or high resolution, with more recent studies tending towards 10 m or less [19,20].Thus, we set the spatial requirement of the DSS to the current interpretation of sub-field scale at 10 m or higher resolution.The temporal resolution requirements are sub-daily to allow for inter-day planning.The Google PageSpeed Insights evaluation tool was used to evaluate the interface for implementation, speed, and usability.PageSpeed Insights evaluates a web page for both desktop and mobile performance and provides scores ranging from 0 to 100, along with some reasoning for the scores [21].
The design of the system was driven by the need for data structures and display technology to be easily modified by other scientists or developers trying to communicate similar types of model results.The DSS was developed on free and open source software in order to be as accessible as possible to researchers.In summary, we propose a system with two sets of design requirements (Table 1), one set meets criteria designed to plan agricultural management practices based on modeled forecasts, and another set allows researchers with similar challenges a free, and open source method to communicate model outputs with similar spatial and temporal resolution needs.

System Components
The DSS is composed of three major components (Figure 1): (1) the model, which acquires, preprocesses the necessary hydrologic forcings, runs the watershed model, and outputs spatially distributed VSA forecasts; (2) a data management structure, which converts high resolution rasters into overlay web map tiles; and (3) the user interface component, a web page that allows the user to interact with the processed output.The first two components of the system must be automated, as forecasts are updated regularly (four times per day in this case).The final component, the interface hosting, only needs to be put in place once.This allows the system to seamlessly host the overlay tiles even while they are being updated.

SWAT-VSA Model Component
The model framework and development is described in detail by [22].Briefly, the model links a VSA watershed model [23] with the National Oceanic and Atmospheric Association (NOAA)'s Global Forecast System-Model Output Statistics (GFS-MOS) forecast.SWAT is a process-based, semi-distributed watershed model, developed by the US Department of Agriculture-Agricultural Research Service (USAD-ARS) to estimate the effects of agricultural landuse and management on water quantity and quality [24].SWAT-VSA modifies the soil layer with a Topographic Wetness Index (TI)/soil hybrid layer [25], to better models VSAs.The SWAT-VSA model was initialized for the South Fork of the Shenandoah River watershed using ArcSWAT2012 and an ArcSWAT plugin, TopoSWAT (http://ww2.bse.vt.edu/eastonlab/), developed to automatically generate the TI-Soil hybrid layer used for SWAT-VSA initialization [25]).TopoSWAT provides the necessary soil data to calculate TI via linkage to the United Nations Food and Agriculture Organization (FAO) soils database [26].Input data used in SWAT-VSA/GFS linkage consists of both dynamic and static data.The spatial data required for the initialization of the hydrology prediction model are all static inputs (soil, landuse, and elevation data).Static spatial inputs include landuse from the National Land Cover database [27], and a combination of 3 m and 10 m resolution DEMs from the United States Geologic Survey (GHCN) National Elevation Dataset (NED) resampled to 3 m covering the study area.No thresholds were applied during HRU definition in order to generate a full-HRU distribution.The final initialization resulted in five subbasins and 859 HRUs over the study domain.
SWAT-VSA is forced with dynamic meteorological forecasts to produce a 24-96 h distributed hydrologic forecast described in [22].The DSS downloads and parses meteorological data from the GFS-MOS forecast dataset every six hours.The GFS-MOS time series is obtained from an automatic implementation of the SWATmodel [28] and getMet [29] R packages.The SWAT-VSA model is then re-initialized with the dynamic meteorological inputs for each model run to produce predictions for each model forecast day.

Data Structure Component
The Open Street Map (OSM) Slippy Map structure was chosen as it provides a means to display overlay rasters at the field-scale and higher resolutions with no specialized software other than common web browsers [30].To create these map tiles with necessary names and file locations, a Python implementation of GDAL2Tiles capable of running in parallel creates a layered structure of map tiles that represents a georeferenced image at various zoom levels as a group of small, individually transferable images [31].Tiles are created from a georeferenced image by separating the image into a file tree of named map tiles in a particular structure.At each zoom level, the latitude

SWAT-VSA Model Component
The model framework and development is described in detail by [22].Briefly, the model links a VSA watershed model [23] with the National Oceanic and Atmospheric Association (NOAA)'s Global Forecast System-Model Output Statistics (GFS-MOS) forecast.SWAT is a process-based, semi-distributed watershed model, developed by the US Department of Agriculture-Agricultural Research Service (USAD-ARS) to estimate the effects of agricultural landuse and management on water quantity and quality [24].SWAT-VSA modifies the soil layer with a Topographic Wetness Index (TI)/soil hybrid layer [25], to better models VSAs.The SWAT-VSA model was initialized for the South Fork of the Shenandoah River watershed using ArcSWAT2012 and an ArcSWAT plugin, TopoSWAT (http://ww2.bse.vt.edu/eastonlab/), developed to automatically generate the TI-Soil hybrid layer used for SWAT-VSA initialization [25]).TopoSWAT provides the necessary soil data to calculate TI via linkage to the United Nations Food and Agriculture Organization (FAO) soils database [26].Input data used in SWAT-VSA/GFS linkage consists of both dynamic and static data.The spatial data required for the initialization of the hydrology prediction model are all static inputs (soil, landuse, and elevation data).Static spatial inputs include landuse from the National Land Cover database [27], and a combination of 3 m and 10 m resolution DEMs from the United States Geologic Survey (GHCN) National Elevation Dataset (NED) resampled to 3 m covering the study area.No thresholds were applied during HRU definition in order to generate a full-HRU distribution.The final initialization resulted in five subbasins and 859 HRUs over the study domain.
SWAT-VSA is forced with dynamic meteorological forecasts to produce a 24-96 h distributed hydrologic forecast described in [22].The DSS downloads and parses meteorological data from the GFS-MOS forecast dataset every six hours.The GFS-MOS time series is obtained from an automatic implementation of the SWATmodel [28] and getMet [29] R packages.The SWAT-VSA model is then re-initialized with the dynamic meteorological inputs for each model run to produce predictions for each model forecast day.

Data Structure Component
The Open Street Map (OSM) Slippy Map structure was chosen as it provides a means to display overlay rasters at the field-scale and higher resolutions with no specialized software other than common web browsers [30].To create these map tiles with necessary names and file locations, a Python implementation of GDAL2Tiles capable of running in parallel creates a layered structure of map tiles that represents a georeferenced image at various zoom levels as a group of small, individually transferable images [31].Tiles are created from a georeferenced image by separating the image into a file tree of named map tiles in a particular structure.At each zoom level, the latitude and longitude of the top left corner of the tile is converted to a z-x-y naming and file-storing scheme.This process is readily automated, which is crucial to communicating outputs that must be updated often.

User Interface
The public facing interface was built using the free Mapbox, JavaScript (JS)-based Application Programming Interface (API), Hyper Text Markup Language (HTML), and Cascading Style Sheets (CSS), bundled into an application with Flask, a web application development platform [32].The DSS interface includes an address search box, legend, zoom bar, basic map manipulation controls, selectable forecast day, and a transparency slider for the overlay tiles.All functionalities of the user interface were designed to be simple and to translate well across devices.The web based DSS (available at: http://zachary.bse.vt.edu/beta) was deployed on a server running the CENT-OS distribution of Linux.The elapsed time between triggering the meteorological forecast download to a complete map-tile update is roughly 4 h, even with the rather humble computational capabilities (8 core, 4 GHz Intel processor, and 32 GB ram) of the test bed server.

Proof of Concept Application
The model component was deployed in the South Fork of the Shenandoah River watershed (HUC 02070005) in the Shenandoah Valley of Virginia.The outlet was defined at the location of the USGS gaging station 01628500.The watershed's 2600 km 2 area is primarily forest (50%), agricultural land (38%).Silt loams dominate the soil distribution and elevation ranges from 310 m to 1336 m with slopes up to 60%.The climate is classified as humid continental and yearly average rainfall in the watershed is 1057 mm [33].Saturation excess runoff generation from soils with shallow restrictive layers at lower landscape positions (e.g., VSAs) accounts for the majority of surface runoff.This location was chosen as a proof of concept test bed based on the success of the short-term hydrologic forecast framework recently tested here [22].Setup and calibration procedures are described in [22], resulting in a model which satisfactorily forecasted the streamflow response and distributed soil saturation classifications in the watershed [22,34].

Results
The output raster in this application with the spatial extent of the study area (roughly 2600 km 2 in web Mercator projection, and at a max zoom of 18), required the server to generate 350,266 new tiles four times per day for each forecast.The system hardware was able to recreate the tile set within the time between every update to the distributed hydrology forecast raster while meeting our temporal resolution requirement.With the zoom at 18, each square pixel of a tile represents and area roughly 0.6 m across, which is more than capable recreating the 3 × 3 m SWAT-VSA forecast output, more than fulfilling our spatial resolution requirement.The user interface (Figure 2) employing the MapBox API and JS library was able to display the map on a variety of devices and PageSpeed Insights provided estimations of the user interface performance (Table 2).
Since all the software used was free, open source, and available to download, the first two of our research design requirements: license and cost were met.The third requirement, world-wide applicability is met with the caveat that each new area has a one-time pre-processing step defining the location and extent of the new model output.For flexibility, a range of raster types can be processed, including jpeg, png, and tif formats [31].The legend can be edited easily by anyone with basic knowledge of HTML and JS.

Discussion
The DSS performed well in meeting the design requirements and was capable of communicating forecasts up to four days into the future at a 3 × 3 m resolution, updated sub-daily.Although rendering tiles regularly for entire overlay map process makes the interface fast and lightweight for the user, it does require at least a multi core server, which will be routinely busy with tile creation.However, this paper demonstrates that reasonable performance can be had through the use of an entry-level server.This result improves upon similar systems, such as SmartScape, an ecological decision making tool built with the GoogleMaps API displaying 30 m resolution rasters, who's designers lists the static nature of displayed model results as a major limitation [18].
The PageSpeed Insights scores (68/100 for mobile and 82/100 for desktop) and mobile friendly designation were primarily due to the simple web page design translating well across different hardware and software platforms.In both the PC and mobile categories, the same major cause of speed bottlenecks was the requirement of external JavaScript script, indicating further optimization of the interface would improve performance.To evaluate the DSS comparatively, similar systems (some of which were recently reviewed in [5]) designed to display large scale spatial data were tested with the PageSpeed Tool (Table 3).The DSS was one of less than half of the tools that were categorized as mobile friendly, and was out-performed in only one category by the Missouri Design Storm Alert System, which does not display high resolution rasters.It received the highest score for Desktop speed and beat the average speed of the other tools by 12 points in the mobile category and 24 points in the desktop category.A major reason many of these tools received low speed scores was nonoptimized images on the interface, and most of the tools were designated as not mobile friendly due to the presence of small text and interaction points on the web pages.The DSS described in this study

Discussion
The DSS performed well in meeting the design requirements and was capable of communicating forecasts up to four days into the future at a 3 × 3 m resolution, updated sub-daily.Although rendering tiles regularly for entire overlay map process makes the interface fast and lightweight for the user, it does require at least a multi core server, which will be routinely busy with tile creation.However, this paper demonstrates that reasonable performance can be had through the use of an entry-level server.This result improves upon similar systems, such as SmartScape, an ecological decision making tool built with the GoogleMaps API displaying 30 m resolution rasters, who's designers lists the static nature of displayed model results as a major limitation [18].
The PageSpeed Insights scores (68/100 for mobile and 82/100 for desktop) and mobile friendly designation were primarily due to the simple web page design translating well across different hardware and software platforms.In both the PC and mobile categories, the same major cause of speed bottlenecks was the requirement of external JavaScript script, indicating further optimization of the interface would improve performance.To evaluate the DSS comparatively, similar systems (some of which were recently reviewed in [5]) designed to display large scale spatial data were tested with the PageSpeed Tool (Table 3).The DSS was one of less than half of the tools that were categorized as mobile friendly, and was out-performed in only one category by the Missouri Design Storm Alert System, which does not display high resolution rasters.It received the highest score for Desktop speed and beat the average speed of the other tools by 12 points in the mobile category and 24 points in the desktop category.A major reason many of these tools received low speed scores was non-optimized images on the interface, and most of the tools were designated as not mobile friendly due to the presence of small text and interaction points on the web pages.The DSS described in this study stands out due to simple design, allowing for higher cross device rendering speed while retaining the ability to display rapid update, high resolution outputs.

Conclusions
This study introduces a web based DSS framework capable of providing large, high resolution rasters of distributed soil saturation forecasts.The data structure and user interface components are capable of reproducing model outputs at the high spatial and temporal resolutions required by end-users.The data structure component employed for displaying the overlay maps is scalable and applicable world-wide limited by hardware capabilities.The interface successfully demonstrated the delivery of large, distributed VSA model outputs as an interactive overlay in a simple web-map application.The design requirements were met, with minimal maintenance work required to confirm cross-device functionally and speed.The accessibility to users, and the flexibility for developers make this framework a useful and powerful tool in supplying important distributed hydrologic forecasts to land managers and decision makers.This work will strengthen the tools available for informing short-term management decisions, ultimately reducing NPS pollution in VSA dominated watersheds.

Figure 1 .
Figure 1.Overview of the DSS including the Global Forecast System weather forecast (GFS-MOS), the model (SWAT-VSA GFS linkage) component, the data structure component, and the user interface.

Figure 1 .
Figure 1.Overview of the DSS including the Global Forecast System weather forecast (GFS-MOS), the model (SWAT-VSA GFS linkage) component, the data structure component, and the user interface.

Figure 2 .
Figure 2. DSS showing a soil saturation forecast for 24 (a), 48 (b), 72 (c), and 96 (d) over farm fields west of Harrisonburg, Virginia.At the center of each screen shot, a large, concentrated area of soil saturation can be seen.Over the forecasts the extent of the area decreases, indicative of a forecasted precipitation then drying period.This illustrates the capability of the DSS to provide daily, sub-field resolution forecasts that communicate the variable nature of NPS pollution in the study area region.

Figure 2 .
Figure 2. DSS showing a soil saturation forecast for 24 (a), 48 (b), 72 (c), and 96 (d) over farm fields west of Harrisonburg, Virginia.At the center of each screen shot, a large, concentrated area of soil saturation can be seen.Over the forecasts the extent of the area decreases, indicative of a forecasted precipitation then drying period.This illustrates the capability of the DSS to provide daily, sub-field resolution forecasts that communicate the variable nature of NPS pollution in the study area region.