Web services for distributed and interoperable hydro-information

Abstract. Web services support the integration and interoperability of Web-based applications and enable machine-to-machine interaction. The concepts of web services and open distributed architecture were applied to the development of T-DSS, the prototype customised for web based hydro-information systems. T-DSS provides mapping services, database related services and access to remote components, with special emphasis placed on the output flexibility (e.g. multilingualism), where SOAP web services are mainly used for communication. The remote components are represented above all by remote data and mapping services (e.g. meteorological predictions), modelling and analytical systems (currently HEC-HMS, MODFLOW and additional utilities), which support decision making in water management.


Introduction
Integrated water management requires an integrated view of water related issues and a way of management reflecting the complexity of the water system. The objective is supported by the integrated approach to components of the hydrological cycle as well as complex utilisation of a wide range of different information services. Very often information services act to solve only a particular part of information support within a distinct application sphere and its respective part of hydrological system.
Among different approaches to integration of these individual services the utilisation of web services should play a dominant role due to its ability to preserve the development of individual specialised systems, and glue them to the powerful distributed system, where each subsystem can fully de-Correspondence to: J. Horak (jiri.horak@vsb.cz) ploy the services of other subsystems and end users are not annoyed by solving individual tasks in different systems, and different requirements for input data and providers. Such issues are sensitive mainly in cross-border localities where different sources, services and approaches complicate demanding integrated management.

Architecture of distributed information system
Information systems evolved from monolithic applications (Dosyukov, 2003). The monolithic application contains all the code necessary to deal with user interface, data processing and database communication. This can be called 1-tier architecture.
The 2-tier architecture frequently called client-server architecture splits the monolithic application into two parts (tiers). The first tier contains "presentation logic" and "application logic", and the second tier provides "data access logic". The "data access" tier can be shared among many applications.
If the application logic is encapsulated into a separate tier, then 3-tier architecture appears. The application logic could be shared among many presentation tiers. This architecture enables to distribute parts of application over network. For this architecture the stability and accurate definition of interfaces among different tiers are crucial.
An n-tier application program is one that is distributed among three or more separate computers in a distributed network. The most common form of n-tier is the 3-tier application, in which user interface programming is in the user's computer, application logic is in a more centralized computer, and needed data is in a computer that manages a database.
The n-tier architecture evolved into Service Oriented Architecture (SOA). The SOA is a design model with a deeply rooted concept of encapsulating application logic within Published by Copernicus Publications on behalf of the European Geosciences Union.
services that interact via a common communication protocol. When web services are used to establish this communication framework, they basically represent a web-based implementation of SOA. The resulting architecture essentially establishes a design paradigm within which web services are a key building block. The SOA based on XML web services builds upon established XML technology layers, with a focus on exposing existing application logic as loosely coupled services. In support of this model, the design principles introduced by SOA (known as the principles of service-orientation) emphasize reuse, statelessness, autonomy, abstraction, discoverability, loose coupling and composability (Erl, 2004).
The architecture of the system determines the logic of the system and its extensibility, scalability and interoperability. The distributed information system integrates individual systems to share data, software and services. Two approaches to the distributed system deployment can be distinguished: -local system is delimited to 1 organisation and situated in a local area network, occasionally only on 1 machine and -global system is set up on a cooperation of 2 and more organisations where Internet plays the role of main communication media for integration.
The local system offers direct sharing of distributed data and other sources. Advantages of local systems could be seen in a more simple institutional solution (better preparation and implementation of necessary rules etc.), more simple technical design, quicker communication, easier reach of required effect, a more stable solution. Main disadvantages are hidden in the solution which is usually specific or unique, reflecting the institutional conditions, specific to some branch or software platform (the organisation commonly builds an united hardware and software environment). Such a specific solution can cause problems during an extension of the system. Seamless interaction among modelling systems, the integration and combination of their functions in order to improve final results, are the main features of Open Modelling Interface (OpenMI, http://www.openmi.org), the output of the European project HarmonIT (Gijsbers et al., 2004). OpenMI should solve or improve the quality of many difficult issues concerning model communication (i.e. spatial and temporal scale differences, system feedback, unit differences, etc.). OpenMI represents an important step towards standardization of the model linking on the local level.
Though OpenMI specification defines an independent interface above modelling systems, the existing implementation tools (OpenMI Environment) do not possess sufficient independence for implementation in heterogeneous systems in global networks (e.g. it is impossible to connect wrappers prepared in C# and Java languages).
Another example of a local system solution is described in Donchyts et al. (2007). The architecture of the RODOS DSS is n-tier and plug-in based, with an Object Relational Mapping solution for system data management and a GIS (Geographical Information System) subsystem. A plug-in is a library which can be easily embedded into the system only by putting it into the specific folder. The plug-in represents an implementation of a particular wrapper which is necessary for every individual numerical model to be integrated to the system. The essential requirement for plug-in construction is to utilise IModel interface predefined by the system providers.
Global systems enable creation of large distributed networks above different platforms, data and solutions. Such systems are universal and robust, where a key issue is the way of integration and an exchange of individual parts. Disadvantages are generally in lower communication speed and a dependency on efficient institutional and technical coordination. On the contrary, global systems enable us to take advantage of independent high-end services, developed and operated by individual organisations. Services can be provided with a guarantee which decreases a risk of failure. In such systems, web services represent one of the best solutions for integration and communication.

Web services
Web service is a software system designed to support interoperable machine-to-machine interaction over a network. Every web service is described by Web Services Description Language (WSDL) which is based on XML (eXtensible Markup Language, http://www.w3.org/XML/). Information system communicates with web services by messages using SOAP (Simple Object Access Protocol, http://www.w3.org/ TR/soap/) as an exchange format. Web services allow different applications from different sources to communicate with each other without time-consuming custom coding due to the use of open standards.
The advantages of distributed web services are even more obvious for applications above heterogeneous sources of data and for the construction of a flexible modular system combining various services.
The standardization process supported and managed by Open Geospatial Consortium (http://www.opengeospatial. org/) brings a definition of set of web services standards, important for implementation of frequent tasks. Web Processing Service (WPS) enables to access pre-prepared processing procedures, calculations or modelling using a defined set of inputs, and produces a defined set of outputs. This service is designed mainly for spatially referenced data. Web Map Service (WMS) produces maps of spatially referenced data dynamically from geographical information. Geographical data is not transferred to end-users. WMS-produced maps are generally rendered in a image format such as PNG, GIF or JPEG, or occasionally as vector-based graphical elements in Scalable Vector Graphics (SVG) or Web Computer Graphics Metafile (WebCGM) formats. This is in Hydrol. Earth Syst. Sci., 12, 635-644, 2008 www.hydrol-earth-syst-sci.net/12/635/2008/ contrast to a Web Feature Service (WFS), which returns actual vector data in Geography Markup Language (GML) format, from which a final map can be constructed, and a Web Coverage Service (WCS), which returns original raster data (http://www.opengeospatial.org/standards). These services can be invoked using a standard web browser by submitting requests in the form of Uniform Resource Locators (URLs) via HTTP GET, or XML documents via HTTP POST.

T-DSS
The concepts of web services and open distributed architecture were fully applied for the development of T-DSS, the prototype customised for a web based hydro-information system. T-DSS is a modular web application system running in an Internet environment using open sources technologies.
The T-DSS is developed within the framework of the TAN-DEM project, but the original idea of such web based distributed systems arose in the TRANSCAT project (EVK1-CT2002-00124) .
T-DSS represents a distributed and a platform-independent system. Originally standalone systems in the category of decision application, modelling servers, data warehouses and relevant information services were integrated with GIS in the unified system where web services were mainly applied for communication.
T-DSS consists of following basic server-side components ( Fig. 1): T-DSS Server, Database management system with Data Abstraction Layer (DAL), Web Services Application Interface (WS-API) and remote Modelling and Data Processing services.
T-DSS server is constructed using ArteGIS Server system and its components. The ArteGIS Server system extends University of Minnesota MapServer capabilities and enables a dynamic generation of the client application including its behaviour. The system offers all basic map composition elements, the linkage of remote components, modelling and processing services and utilisation of Web Map Services (http://www.artegis.cz). Using the method of geo-data visualization, labelling or attribute selection is able to reflect the national lingual and cultural environment, because the client application is dynamically created according to the user who is currently logged in, his access rights, selected language and current time (system checks if requested data is up to date).
Multilingual features of the system were tested in the predecessor of the system in the framework of the TRANSCAT project. For Nestos-Mesta river catchment (thanks to the cooperation with University of Thessaloniki and the Bulgarian Institute of Water Problems) appropriate terms were imported, the only steps needed to transfer the system control (functions, menu) to Greek and Bulgarian languages and to provide appropriate language variants for description, labelling of map layers, attributes for querying etc. A similar multilingual system was prepared for the Czech-German border (Sumava Mts.) and the Czech-Poland border (Bela/Biala river catchment). The visualization system approved the correct presentation of specific Czech, Polish and German characters, but also Cyrillic and Greek Alphabet. The database management system is a fundamental component intended to carry out the management of all system data and data warehousing. PostgreSQL is implemented in a position of a database management system and a PostGIS extension is used for storing the spatial data in a database. This way of spatial data storing provides wide usage possibilities to other systems. The system also allows for connection to other spatial databases to use additional spatial data. User and group management at the database level ensures privileged access to stored data as well as to T-DSS.
The web client is an application written as DHTML (Dynamic HTML) using JavaScript, interpretable by common web browsers. The client provides spatial data visualization and common functions for manipulation of interactive digital maps. More advanced features include the possibility to attach documents (e.g. regulation rules) to map objects (e.g. protection zone) and review them, utilisation of remote mapping servers with WMS, info panels (windows with relevant information e.g. review of current meteorological situation, radar precipitation estimation) and access to modelling and decision applications (see Figs. 3 and 4).

A connection to hydrological and hydrogeological models
Principles of numerical modelling of hydrological processes and description of commonly used methods can be found in Bedient and Huber (2001), Maidment (1993) and Beven (2002). A description of groundwater modelling is provided by e.g. Anderson and Woessner (1992) and Istok (1989).
Linkage of modelling software and geographic information systems is appropriately described in Maidment and Djokic (2000) and Vieux (2004). Analysis of 18 numerical modelling systems for water management was provided within the framework of the TANDEM project (Tylcer et al., 2004) (Table 1). The following features were investigated -embedded models (which processes are simulated, applied codes, mathematical base of applied codes, verification of code, field-testing for validation, level of simplification), field of applications, interoperability (linkage to GIS, utilisation of Earth coordinating systems, remote management and control like a macro language or an application programming interface), price and license terms (price policy, licensing -multiuser, license duration, maintenance), support (updating, technical support, documentation), software features (operating system, modularity, user interface, provided functions, possibility of integration), input and output (obligatory, conditional, optional).
The requirements of end-users in this project indicated an interest in systems which are freely available. We have decided to select for the prototype phase of T-DSS development frequently used software provided free of charge, with wide range of possible hydrological applications, direct linkage to GIS and ability of a remote programming control. HEC-HMS as a representative of hydrological modelling systems and MODFLOW for hydrogeological modelling were selected.
HEC-HMS (http://www.hec.usace.army.mil/software/ hec-hms/) simulates the precipitation runoff processes of all types of catchments which can contain dams and reservoirs. Selection of the catchment model distribution type (lumped, semidistributed, fully distributed) and wide selection of the hydrologic and hydraulic physically-based methods (loss, hydrologic transformation, overland and channel flow, baseflow, snowmelt) belong to the main advantages of HEC-HMS (Maidment, 1993;Bedient and Huber, 2001). Direct linkage to GIS (HEC-GeoHMS/ESRI) and models price (freeware) are further arguments for using of this software (see Maidment and Djokic, 2000). Event and continuous modelling (SAC-SMA) are among the model capabilities too.
MODFLOW (MODular three-dimensional finitedifference ground-water FLOW model) (http://water. usgs.gov/nrp/gwsoftware/modflow2000/modflow2000.html) is a three-dimensional finite-difference groundwater model that was first published in 1984. MODFLOW simulates steady and nonsteady flow in an irregularly shaped flow system in which aquifer layers can be confined, unconfined, or a combination of confined and unconfined. Flow from external stresses, such as flow to wells, areal recharge, evapotranspiration, flow to drains, and flow through river beds, can be simulated. It has a modular structure that allows it to be easily modified to adapt the code for a particular application. Harbaugh (2005)  of its ability to simulate a wide variety of systems, its extensive publicly available documentation, and its rigorous US Geological Survey peer review, MODFLOW has become the worldwide standard ground-water flow model. Interfaces to selected HEC-HMS and MODFLOW systems have been developed to provide an integrated system with the capability to utilize numerical modelling for the solution of various water management tasks. The distributed information system utilizes four kinds of services related to modelling -services that receive models' input data from remote servers (numerical models, observed values), services as wrappers for modelling software (HEC-HMS, MODFLOW, additional utilities), service for data sharing and services for data visualization (map layers, images, graphs).
The first service receives input data and passes it to an integrated database with appropriate metadata.
The model wrappers are able to read the necessary input data from the database and update the model input files. Models are run in the sequential order (results from one model may be used as an input for another model) and the results are stored in the integrated database. Both the management and iterative processing are supported by model parameters as well as space and time extent specifications, which are similar to the JAMS (Jena Adaptable Modelling System) spatial, temporal and model contexts (Kralisch and Krause, 2006).
The Visualization service allows the user to obtain a result for a selected place and time in a suitable format (map layers can be visualized by map server). Figure 2 shows a simplified scheme of basic components needed for modelling in the T-DSS system. On the left side there are remote sources of input data necessary for models. Input data is stored in an integrated database, and model wrappers are called automatically at given times or upon the user's request. Data sharing enables reading and storing the models' data. Other services support data imagery, geographical data transformation etc.

Programming interface to HEC-HMS
One of the main outputs of a hydrological model is the predicted water flow for selected river profiles. For this purpose the HEC-HMS 1-D hydrological model was integrated into the system. The HEC-HMS program is designed for the Windows operating system but the core system of T-DSS server operates on the Linux system. The web services help to overcome the differences and provide remote control that can allow data exchange and model launching.
The interface is a wrapper over the HEC-HMS hydrological rainfall-runoff model that allows for Web Service binding. The input data is derived mainly from precipitation predictions. Predicted precipitations may be obtained from various sources -e.g. the ALADIN/LACE model is recommended for a short-term prediction, the GFS model (http:// www.wetterzentrale.de/) for a medium-term prediction. The web client enables management of input and visualisation. Figure 3 depicts the web client tested for Bela/Biala pilot area in the TRANSCAT project where HEC-HMS models for both Czech and Polish parts were implemented.

Programming interface to ModFlow 2000
Interface to ModFlow 2000 is intended to modify and compute a hydrogeological model. The wrapper is written in PERL language as a Web service for Linux system. The service allows changing the model's input data, computing the model as well as processing the resulting data to a form suitable for visualization. The resulting georeferenced raster file and vector isolines of underground water levels are visualized through the University of Minnesota Map Server in the map client. Figure 4 shows the raster of groundwater level as a result of ModFlow modelling in the Czech part of Bela/Biala pilot area. The interface can also provide a calculation of baseflow contribution for rainfall-runoff modelling.

Programming interface to additional utilities
Various additional utilities and systems, such as GRASS GIS, may be wrapped as Web Services and used in the framework of T-DSS. GRASS (Geographic Resources Analysis Support System) (http://grass.itc.it/) is a raster/vector GIS and image processing system, which contains over 350 programs and tools to render maps and images; manipulate raster, vector, and sites data; process multi-spectral image data; and create, manage, and store spatial data (Neteler and Mitasova, 2002).
In this way, an interpolation service was designed for mDSS (Mulino Decision Support System) (http://siti.feem. it/mulino/). The service is accessible to mDSS and any other DSS seeking to obtain results from the T-DSS analytical engine. The interface has been tested in various situations and is ready for use at the T-DSS side. The interpolation service of T-DSS receives XY points with values, delimiting polygons and processing parameters, returns the requested statistical information of a selected area or returns a raster file with interpolated values (e.g. it is possible to send measured precipitation data with coordinates, catchment polygon and optional parameters and obtained total precipitation per catchment or raster with interpolated precipitation values). mDSS (or other system equipped with similar interface) can send data for external processing and utilise the obtained result in the system. Such "outsourcing" can displace specific processing out of the system and utilise the outer specialised services.

Case study
Two following examples demonstrate a possible application of T-DSS prototype and utilisation of web services. Both case studies are hypothethical because only part of them is already implemented. Procedures are described step-by-step to create a clear picture of software system operation.

Withdrawal permission
1st case study reflects the situation when a user has to decide about a permission of a new groundwater withdrawal in a certain place (e.g. a construction of a new well). The user needs information if the proposed withdrawal will influence the water level in existing pumping objects and identify relevant owners.
After login to T-DSS, an introductory map composition according to user preference is automatically displayed. The user enters coordinates of the new intended well or they are imported from a delivered electronic form. Alternatively, he/she locates the new well in a map. To improve orientation in the map, the map composition can be changed and new map layers can be added, including e.g. orthophotos from remote map servers (utilisation of web mapping services like WMS).
After the localisation a requested well discharge is entered. T-DSS determines if any model of groundwater flow in saturated zone is available. T-DSS has to check both institutional and technical accessibility and conditions. If the availability is approved, T-DSS sends a request for modelling of groundwater flow including a new withdrawal.
The model equipped with an appropriate interface is exposed to web services of end-users (through web clients of end-users). An end user can only run the model with changed groundwater discharge rates at selected pumping wells. The result is delivered back to the user client e.g. in the form of raster image of groundwater head and induced drawdown, and displayed on the background map.
The user will display all pumping objects in the area. If information about pumping objects is not stored in the local system or it may not be updated, it is requested from remote servers like a hydrometeorological institute, register of boreholes etc.
T-DSS can select all objects in the area influenced by the new withdrawal. The ownership of the influenced object may be stored directly in a description of the object or it can be requested from cadastral map. T-DSS will identify lots where the influenced pumping objects are located (if such spatial operation is not implemented in the local system it can be requested from remote spatial processing server) and provide a list of owners with needed contact information. Ideally, the identification of owners is provided on the server of the cadastral office, where up-to-date situation is guaranteed.
Finally, the user utilises the information about the new groundwater withdrawal impact for decision making.

Runoff prediction
The second case study describes the situation when the user needs to predict runoff for certain place and time. The runoff prediction is obtained from a pre-prepared numerical rainfall-runoff model. The user locates a place, for where the prediction of runoff (flow rate or height) is requested and indicates the time span of a simulation. Location can be done through coordinates, clicking in the map of web client or searching the name of the place or profile. Next, the system evaluates the requested time span of a simulation and availability of time series for the predicted rainfall. Event models are applied for short-time forecasts, SAC-SMA is opted for long-term forecasts with available time series data and a probabilistic model based on climatic data is selected for long-term forecast without time series data. Also, the system determinates the nearest profile on water body to the requested location. The system checks the availability of models (which model schematisation spatial extent covers the requested location, models accessibility both institutional and technical, satisfactions of other conditions). Then the request for modelling is sent to the appropriate and available service. The modelling server starts to process the request. It may ask for the appropriate input data (precipitation, evapotranspiration, snow volume, water content etc.) from meteorological and water management au-thorities. The modelling can be improved by utilisation of some external pre-processing on remote servers e.g. application of the best interpolation procedure for precipitation input data, modelling of snow melting, estimation of baseflow from hydrogeological modelling etc.
The final result of runoff modelling is returned and displayed in a graphical form to support decision making.

Conclusions
Web based distributed information systems offer open and platform independent architecture. Such systems represent a promising solution for integration of heterogeneous services and an effective way to create complex systems from partial, independent systems. A prototype of T-DSS provides an example of how to implement these ideas. The system combines various services, data sources and also provides special support for international regions. The decision-making is supported by numerical modelling tools; web based wrappers have been developed for HEC-HMS, MODFLOW 2000 and GRASS GIS.
T-DSS is ready to be tested in real conditions. It is intended mainly for decision makers on local and regional levels -municipalities, county and regional authorities, selected state bodies like management of natural protected areas, environmental protection agencies, directorates, inspectorates, management of water catchment. Outside public administration also non-governmental organisations and various associations are taken into account. Complementary groups of users are recruited from selected commercial subjects oriented to water supply and sewage, irrigation, energy production etc. A properly customised version, where the information support is emphasized and modelling capabilities are most likely limited, is intended for the public (e.g. public discussion about plans, investements).
The distributed system relies on cooperation of individual parts. If different organisations are in charge of these parts, the cooperation has to be agreed. Next, technical aspects of cooperation are to be solved -e.g. selection of appropriate communication channels, data format exchange, periodicity, verification of system operating (log recording), etc. In these technical aspects the web services represent an appropriate tool for implementation of distributed systems.
The most sensitive issue seems to be the utilisation of numerical modelling. The system provides services of numerical modelling for various tasks in water management. Development of effective interfaces to such systems is not only a task for software engineering (model wrapper, remote management, result presentation), but above all depends on the following: -a conceptual solution, model development and calibration, -input data flow, www.hydrol-earth-syst-sci.net/12/635/2008/ Hydrol. Earth Syst. Sci., 12, 635-644, 2008 -data storing, -definition of processes for deployment these models and -their integration in the overall information system.
It is important to emphasize that system integrates various existing services and the result cannot be better than data and services provided by individual systems; nevertheless, the remote specialised, leading edge sources and services can be involved. T-DSS provides a common entry to these systems/services, enables their use in a more sophisticated way (e.g. automation of entering data to modelling system, preprocessing, postprocessing) and also to compare results from individual services, which improve the reliability of the overall system and the confidence level for users.
Model selection and calibration is a demanding expert's task. The created models must be still under expert control. Deployment of the system has to be organised according to the restrictions related to source data, models and services, and be under control (or with tight cooperation) of authorities responsible for providing monitoring, predicting and warning tasks.
Data support seems to be less complicated, especially for the basic data sets. When the application is intended for public administration, free access to topographical maps of medium and large scales (including cadastral information) in Czechia, for example, is assured. For other subjects and other data sets, the situation is more difficult and in several cases conditions for data supply are not transparent. Further improvement of data availability (transparency, accessibility) is anticipated with the implementation of INSPIRE (Nougeras et al., 2005).
The web services utilised in distributed hydroinformation systems offer mainly a great flexibility and ability to integrate various independent services. The successful implementation of a global distributed system would require more complex management and extended cooperation among individual subjects and services.