Creation of a Google Maps Interface for Publishing Hydrologic Observations Data in the Little Bear River
CEE 6440 Semester Project Report
Jeffery S. Horsburgh 12-7-2007
Abstract
An environmental monitoring and telemetry system has been established in the Little Bear River of Northern Utah to investigate water quality issues. Streamflow, water quality, and meteorological sensors have been installed and are currently measuring a suite of environmental variables with frequencies ranging from every 30 minutes to daily. These data are being stored in a relational database that implements the CUAHSI Observations Data Model and are being published through a variety of Internet based applications that provide users with data visualization, summary, and analysis capabilities. This paper describes the creation of an Internet Map Server interface for these data using Google Maps as the GIS engine. This Internet map server demonstrates many of the components of a larger Hydrologic Information System for the Little Bear River and demonstrates how freely available software such as Google Maps can be leveraged to produce tools for publishing hydrologic data on the Internet.
1.0 Introduction
Recently the National Science Foundation sponsored eleven Environmental Observatory test bed projects across the country. These test beds are part of the WATERS (WATer and Environmental Research Systems) network, and each was selected to demonstrate techniques and technologies that could be used in the design and implementation of a national network of large scale environmental observatories. These technologies range from innovative application of environmental sensors to achieve a better understanding of the stores and fluxes of environmental constituents to work related to publishing observations data in common formats that can be accessed by investigators nationwide.
The Little Bear River in Cache County, Utah was selected as one of these test beds with the overarching goal of investigating the use of water quality sensor data as surrogate measures for water quality constituents that cannot be measured with high frequency or in real time – for example, using turbidity as a surrogate measure for concentrations of total suspended solids (TSS) or total phosphorus. Given this goal, researchers from Utah State University have worked over the past year to install a network of environmental sensors, including water level, water quality, and meteorological sensors in the Little Bear River watershed to create the data streams needed to complete the objectives of the test bed project. High frequency measurements of turbidity and other constituents are being used to create high frequency estimates of TSS and total phosphorus concentrations and loads, which is leading to a much greater understanding of the spatial and temporal patterns in pollutant loading within the watershed through the use of relatively inexpensive, high frequency sensor data rather than a large number of expensive chemistry samples.
Collection and management of high frequency monitoring data requires sophisticated hardware and software tools that include the sensors and dataloggers used to record the observations, the telemetry system components used to transmit the data from the location at which they are measured to a central repository, and the database and software technology required to manipulate, manage, store, and disseminate the data. Collectively, these components can be referred to as cyberinfrastructure, and, of these components, one of the most important is the public interface that provides user access to the data. One very effective way of providing public access to observations data is through a GIS enabled Internet Map Server interface. GIS based Internet Map Servers can be used to provide spatially explicit, point and click access to observations data in a way that allows users to orient themselves spatially while investigating the spatial and temporal relationships that may exist across sampling locations.
This document describes an Internet Map Server interface that has been built for providing access to the Little Bear River test bed observational data through an Internet browser. The specific objectives of this Internet Map Server are to: 1) create a simple to use website for plotting monitoring site locations and other useful geographic layers using freely available Geographic Information Systems (GIS) technology; 2) provide point and click access to the data collected at each monitoring site through a map based display; 3) create the ability to display current conditions within the watershed for selected environmental variables for which observations are being made; and 4) create the ability to query the observations data spatially and map monitoring sites where data is available for selected variables. This document describes the Little Bear River monitoring network and the cyberinfrastructure components required to complete the path between the sensors making the observations to the map server that has been developed as a public interface for these data.
2.0 Existing Internet Map Server Technology
Many different technologies currently exist for creating Internet Map Server applications. These range from powerful commercial solutions such as ESRI’s ArcGIS Server, which provides the capability to publish spatial data content and geoprocessing functionality over the Internet, to free or low cost applications such as Microsoft Virtual Earth or Google Earth, which provide free tools for visualizing basic GIS data, but do not provide much in the way of geoprocessing capability. There are several considerations in choosing a particular technology for use in creating an Internet Map Server application. These include: 1) what types of data are to be presented via the application; 2) what functionality is required – i.e., how will users interact with the application; 3) who are the potential users of the application and what is their GIS skill level; and 4) what is the skill level of the application developers? The following are some examples of Internet Map Server applications that use a variety of available software technologies.
2.1 Bear River Watershed Information System – ESRI ArcIMS
The Bear River Watershed Information System Internet Map Server (BRWIS-IMS http://water.usu.edu/mapviewers/bearrivermap/) was built to provide users with access to GIS datasets for the Bear River Basin of Utah, Idaho, and Wyoming. In addition, the features of a few of these datasets have been hyperlinked so that when users click on them in the map they are taken via hyperlink to data collected at those sites. The BRWIS-IMS was implemented using ESRI’s ArcIMS software (ESRI, 2007a). Advantages of ArcIMS include: 1) for the web image services that the BRWIS-IMS uses, the only client software needed is an internet browser, making the application platform independent and 2) the GIS image services published through ArcIMS can be consumed using a number of other GIS software products such as ESRI’s ArcMap. However, the disadvantages of ArcIMS are: 1) it is not a simple product to install, configure, and administrate and requires a relatively high degree of user knowledge to implement, and 2) it is a commercial product that requires an expensive software license to run in a server environment.
2.2 CUAHSI Hydrologic Information System DASH – ESRI ArcGIS Server
The CUAHSI Hydrologic Information System Data Access System for Hydrologists (CUAHSI HIS DASH – http://his02.usu.edu/dash/) is an Internet Map Server application that has been built using ESRI’s ArcGIS Server (ESRI, 2007b) and has already been implemented on a server at each of the WATERS Network test bed sites. It is a custom application that was developed within Microsoft Visual Studio .Net 2005 using ASP.Net with the purpose of providing the test bed investigators with an interface for publishing their environmental observations data. Advantages of ArcGIS server and DASH include: 1) like the BRWIS-IMS, the only client software needed for the application is an Internet browser and 2) ArcGIS server provides all of the powerful geoprocessing capabilities of the ESRI GIS software products, and these can be published through the browser interface. Similar to ArcIMS, however, ArcGIS server requires quite a lot of technical expertise to use and an expensive software license to implement.
2.3 HydroSeek – Microsoft Virtual Earth
Hydroseek is an ontology-aided search engine for finding scientific data on water quality and hydrology from several different data sources in the United States (http://www.hydroseek.org). Hydroseek uses the Microsoft Virtual Earth map interface (Microsoft, 2007) to provide spatial context to monitoring sites where observations data are available. The Microsoft Virtual Earth map interface is a programmable component that has been embedded within the Hydroseek application. Hydroseek controls the look and feel of the Virtual Earth map using custom code written by the Hydroseek application developers. Advantages of using this type of approach include: 1) Microsoft Virtual Earth is free to use within Internet Map Server applications and can be customized using an application programmers interface (API); 2) Microsoft Virtual Earth provides simple GIS functionality without a lot of overhead – i.e., application developers can embed GIS functionality within their applications without purchasing, serving, or maintaining the GIS engine, which is taken care of by Microsoft; and 3) similar to the BRIS-IMS and CUAHSI HIS DASH the only client software needed is an Internet Browser. However, Microsoft Virtual Earth has limited GIS capability and little to no geoprocessing functionality and application developers must first learn how to use the API.
3.0 Little Bear River Map Server Architecture
The specific goal of the effort described in this paper was to create an Internet Map Server interface similar to those that have been mentioned above, but with the following functionality for providing access to the Little Bear River test bed observational data: 1) the application should be available through an Internet browser, should implement freely available Geographic Information Systems (GIS) technology, and should not require any other client software to run; 2) the application should be able to display monitoring site locations and other useful geographic layers such as streams and watershed boundaries; 3) the application should provide point and click access to the data collected at each monitoring site through a map based display; 4) the application should create the ability to display current conditions within the watershed for selected environmental variables for which observations are being made; and 5) the application should be able to create the ability to query the observations data spatially and map monitoring sites where data is available for selected variables.
Given these requirements, the Little Bear River Internet map server has been developed as a web application in the Microsoft Visual Studio .Net Interactive Development Environment using Visual Basic and ASP.Net. The Little Bear River Internet map server requires only an Internet browser on the client end, making it platform independent. Google Maps (Google, 2007a) was chosen as the GIS engine for the application because like Microsoft Virtual Earth it is free and does not require any setup and maintenance, it is relatively simple to use (unlike ArcIMS and ArcGIS Server), and it supports the addition and display of GIS datasets such as streams and watershed boundaries, which is something that is not simple in Microsoft Virtual Earth.
In addition to the mapping component, there are several other components that underlie the map server and enable its functionality. The major components of the overall system include: 1) the Little Bear River monitoring and telemetry network that generates the observations; 2) a central observations database where the observations are stored in a relational schema; and 3) the Internet map server web application that provides users with access to the data stored in the central observations database. Figure 1 shows these components within the overall system architecture for the Little Bear River map server. The sections following Figure 1 describe the first two components in more detail, after which the remainder of this document describes the Little Bear River Internet map server.
Figure 1. Overall architecture of the Little Bear River Internet map server.
4.0 Little Bear River Monitoring and Telemetry Network
The Little Bear River monitoring network currently consists of seven water quality and streamflow monitoring sites, two weather stations, and four radio repeaters that are used to transmit the data from the remote monitoring sites to a central server where the data are stored in a relational database. Table 1 lists each existing site and provides a list of all of the variables for which data are being collected.
Table 1. Little Bear River monitoring network sites.
Generally, data collected at each of the remote monitoring sites is transmitted through one or more repeaters via spread spectrum radio telemetry to one of two remote repeater/base station sites. At these sites, the radio transmissions are converted to TCP/IP packets and sent via an Internet connection to a single base station computer located at the Utah Water Research Laboratory. Figure 2 shows the locations of each of the network sites in the Little Bear River watershed, and Figure 3 shows the telemetry linkages between each of the sites.
5.0 Little Bear River Observations Database
The monitoring and telemetry system delivers the data from each of the monitoring sites to a base station computer located at the Utah Water Research Laboratory hourly. The data are stored on this base station computer in a set of comma delimited text files, one for each monitoring site, and new data are appended as they are received. The data are then loaded into an instance of the CUAHSI Observations Data Model (ODM) that has been implemented within Microsoft SQL Server 2005. The ODM is a standard relational database schema used within the CUAHSI Hydrologic Information System (HIS) for the storage of time series of point observations from experimental sites and watersheds and facilitates data publishing, querying, retrieval, and analysis among domains and investigators (Tarboton et al., 2007). Figure 4 shows the CUAHSI ODM schema.
Figure 2. Little Bear River monitoring network site locations.
Figure 3. Little Bear River monitoring network telemetry system links.
Figure 4. CUAHSI ODM Schema (Tarboton et al., 2007).
Since new data are streaming in from the sensors to the base station computer every hour, loading of the sensor data into the ODM database has been automated using the ODM Streaming Data Loader (Horsburgh and Berger, 2007). This ensures that the most recent data are always loaded into the ODM database within an hour of when they become available. The Streaming Data Loader is an application that was developed to enable users to map streaming sensor data files to the ODM Schema (i.e., create all of the required metadata within the ODM database to enable the observations to be loaded), and then, once this mapping is complete, schedule the automatic loading of data from these files into the ODM database. Loading of the Little Bear River data has been scheduled to occur hourly to coincide with the frequency with which data are being delivered to the base station computer.
All of the data presented via the Little Bear River Internet map server are queried directly from the Little Bear River ODM database. To do this, the application uses a direct SQL connection to the ODM database, and, because of this, data are available via the map server website immediately after being loaded into the ODM database.
6.0 Google Maps Application Programmer Interface
The GIS functionality within the Little Bear River Internet map server is enabled by the freely available Google Maps Application Programmer Interface (API) (Google, 2007b). This API allows developers to embed Google Maps within web applications and then control its behavior and functionality through custom JavaScript code written by the developer. The Google Maps API is a free beta service that is available for any website that is free to consumers. The following sections describe specific functionality that can be accessed through the Google Maps API and that was used to create the functionality of the Little Bear River Internet map server. All of this functionality was created using JavaScript within the HTML code of an ASP.Net application.
6.1 Adding Google Maps Standard Controls
The Google Maps API provides developers with several built in controls that can be added to the map using JavaScript. These include a large and a small map control for panning and zooming, a scale control for controlling the map scale, a map type control for allowing users to control the type of map that is displayed, and an overview map control that is a collapsible overview map in the corner of the Google Map. The following figure shows how each of these controls were implemented within the Little Bear River Internet map server. These controls were added to the map to provide the Little Bear River Internet map server with standard GIS functionality such as panning and zooming.
Figure 5. Google Maps controls in the Little Bear River Internet map server.
6.2 Adding GIS Layers as KML
Google Maps has three different map types that can be controlled by the user. The first is a map display with several cartographic layers such as roads and cities. The second map type displays satellite imagery, and the third type displays a hybrid of both of these (i.e., some cartographic layers are displayed on top of the imagery. Unfortunately, the cartographic layers shown in Google Maps are not very detailed and show only very limited water resources information. For example, there are no stream lines within Google Maps. In addition, users can switch map types, but they do not have any control over the base cartographic layers that Google Maps provides. However, the Google Maps API does allow developers to add cartographic layers to the Google Maps display by using GIS datasets stored in Keyhole Markup Language (KML) format. KML is a file format used to display geographic data in Google Maps and uses a tag-based structure with nested elements and attributes that is based on the XML standard (Google, 2007b). KML files can be representations of vector data layers (i.e., points, lines, or polygons) as well as image overlays.
For the purpose of providing hydrologic context within the Little Bear River Internet map server and to demonstrate how the limitations associated with the standard cartographic layers in Google Maps can be overcome by adding GIS layers to the map as KML files, several vector GIS layers and a single image overlay were added to the Google Map on the Little Bear River map server (see Figure 6). The KML files for the vector GIS coverages were created by first projecting them into the geographic projection used by Google Maps (i.e., geographic coordinates with a datum of WGS84) and then exporting the layers from ArcGIS as KML using a custom extension for ArcMap (Martin, 2007). This extension was downloaded from the ESRI ArcScripts website (http://arcscripts.esri.com/). In the case of the image overlay, the image was first imported to Google Earth (Google, 2007c) and then exported as a KML image overlay. Finally, functionality was created within the Little Bear River Internet map server for toggling these layers on and off.
Figure 6. Vector GIS overlays added to Google Maps using KML.
6.3 Plotting Points and Adding Custom HTML Tags
Within Google Maps, objects called “Markers” identify points on the map. For the Little Bear River Internet map server, Markers are used to display the locations of the monitoring sites. These Markers are added to the map using the latitude and longitude coordinates for the monitoring sites, which are queried from the ODM database. Within Google Maps, Markers are interactive objects that can be clicked on, and, as such, developers can capture that click event and add custom code to respond to it. For example, the Little Bear River map server has been programmed so that when users click on a monitoring site a fly-out window is generated that provides users with functionality to view the available data at the selected site. The HTML code for the information displayed in this fly-out window is dynamically generated by the application using information queried from the ODM database.
7.0 Little Bear River Internet Map Server Functionality
The Little Bear River Internet map server was built to provide access to the Little Bear River test bed observational data through an Internet browser. Because of this, all of the functionality of the map server is platform and browser independent. The following figure shows a screen shot of the Little Bear River Internet map server, which is available at http://water.usu.edu/littlebearmap/. In the sections following the figure, the specific functionality of the map server that was created to meet the objectives listed above is described in more detail.
Figure 7. Screen shot of the Little Bear River Internet map Server.
7.1 Accessing Monitoring Site Data
When users click on one of the monitoring site Markers within the Google Map, they are rewarded with a fly-out window that provides information about the site, a hyperlinked photo, and two hyperlinks that provide access to the monitoring data collected at the selected site. The first hyperlink (View and download data) launches the Time Series Analyst application (Horsburgh et al., 2007) for plotting, summarizing, and downloading the data collected at the selected site. Figure 8 shows a screen shot of the Time Series Analyst Application.
Figure 8. Screen shot of the Time Series Analyst application for visualizing, summarizing, and downloading monitoring data.
The other hyperlink on the monitoring site fly-out (View current conditions) displays the most recent observations for each variable for which data are collected at the selected site. This functionality is particularly useful for monitoring the performance of the monitoring and telemetry system and for viewing the current conditions in the watershed. The following screen shot shows how the current conditions are displayed for a monitoring site. All of the important metadata for each variable are shown as well as the date/time and value of the most recent observation in the ODM database. In addition, the last 25 observations from the database are plotted in a sparkline plot to show recent trends in the data.
Figure 9. Display of current conditions for a monitoring site in the Little Bear River.
7.2 Spatial Queries on Monitoring Sites
Using the Site Query functionality, users can select a variable of interest and then the map will be updated to only show sites for which data are available for the selected variable. This functionality provides users with a visual indication of the spatial distribution of the sites that have data for a selected variable. The list of available variables is queried directly from the ODM database, as is the list of sites for which data are available for the selected variable.
8.0 Discussion and Conclusions
The Little Bear River Internet map server demonstrates how environmental observations data can be published through a GIS map based interface that provides simple point and click access to the data. Displaying the locations of monitoring sites on a map and in the context of other GIS layers provides users with a means by which they can orient themselves spatially and by which they can begin to see the spatial relationships between sampling sites and the features around them. This can break down one of the barriers to efficient data access, which is discovering which data are available and where they were collected. In addition, by creating this application such that it runs in an Internet browser, it has been made platform independent, which eases another constraint to efficient data access.
The application has been created using the freely available Google Maps API, which provides the GIS functionality. Although Google Maps has only a limited set of functionality (i.e., it has limited cartographic layers and does not provide any GIS processing or spatial analysis capabilities) it can be an effective and economical way to present simple spatial information such as the locations of monitoring sites, streams, watershed boundaries, etc. without the overhead of implementing, configuring, and managing more sophisticated and potentially much more expensive map server technologies. The limitations in the standard cartographic layers that are native to Google Maps can be overcome to some degree by adding custom layers to the map using KML. However, it was observed that the performance of Google Maps deteriorated when multiple layers were displayed at the same time. Short of this, the Google Maps API is a flexible tool for customizing Google Maps to provide desired functionality.
The Little Bear River map server also demonstrates how a relatively simple interface can be implemented on top of the more complicated components of a greater Hydrologic Information System, including the monitoring and telemetry system and the central observations database. Effective dissemination and communication of the data that are being collected within the Little Bear River would be impossible without public interfaces like the Little Bear River map server that provide users with access to the data.
References
ESRI. 2007a. ArcIMS – Publish Maps, Data, and Metadata on the Web. http://www.esri.com/software/arcgis/arcims/index.html. Last accessed 11-6-2007.
ESRI. 2007b. ArcGIS Server – Comprehensive Server Based GIS. http://www.esri.com/software/arcgis/arcgisserver/index.html. Last accessed 11-6-2007.
Google. 2007a. Google Maps. http://maps.google.com/. Last accessed 11-13-2007.
Google. 2007b. Google Maps API. http://www.google.com/apis/maps/. Last accessed 10-24- 2007.
Google. 2007c. Google Earth – Explore, Search, and Discover. http://earth.google.com/. Last accessed 11-13-2007.
Horsburgh, J.S., and J. Berger. 2007. ODM Streaming Data Loader Version 1.0. http://water.usu.edu/cuahsi/odm/files/ODMSDL/1_0/ODM%20SDL%201_0%20Software%20Manual.pdf. Last accessed 10-24-2007.
Horsburgh, J.S., Satterfield R., and D.K. Stevens. 2007. Time Series Analyst. http://water.usu.edu/odmanalyst/. Last accessed 10-24-2007.
Martin, K. 2007. Export to KML 2.4.1. http://arcscripts.esri.com/details.asp?dbid=14273. Last accessed 10-24-2007.
Microsoft. 2007. Microsoft Virtual Earth. http://www.microsoft.com/virtualearth/. Last accessed 11-6-2007.
Tarboton, D.G., Horsburgh, J.S., and D.R. Maidment. 2007. CUAHSI Community Observations Data Model (ODM). http://water.usu.edu/cuahsi/odm/files/ODM1.pdf. Last accessed 10-24-2007.
|