Joao Ribeiro da Costa, M. Lacerda, H.B. Jesus

The Portuguese Water Resources Information System: using OOP to integrate time series and GIS


ABSTRACT

The Portuguese Water Resources Information System, SNIRH, is owned and operated by the Portuguese Water Institute, INAG. It stores data on climate, hydrology, ground-water and water uses, originating on over 1200 measurement stations in the country, as well as from the day-to-day management tasks of the Institute. Besides being the archive of water resources data collected in Portugal the system was designed aiming at providing the data analysis capabilities required to support hydrological studies and the development of water resources plans. SNIRH's first version was developed in 1990, based on a relational model develped by LNEC and UNINOVA. In 1994 it was decided to do a major upgrade, in order to implement a client server version, capable of handling requests from many different users, in a network environment. ORACLE was selected as the data base management system underlying this new version.

Most data stored at SNIRH originates from field measurements, ranging from rainfall and temperature to water levels and water quality. Sampling is both continuous, like in gauging stations, and discrete, like daily rainfall. As it is widely recognized the relational model is quite limited in terms of dealing with this type of data. After a number of tests it was decided to use an Object Oriented Approach to the problem: a time-series object, TSO, was developed which is capable of storing all sorts of time series generated in SNIRH, as well as performing the required operations. A new fully Object Oriented Language, Sather, was selected for the development. The time series are stored in ORACLE using a Binary Large Object approach, the final result being a quite efficient system. The final result is a Time Series Server, TSServer, which has its own Browsing window and display window. This TSServer can work either isolated or in combination with ArcView2.

In order to fulfill the needs of the various types of studies SNIRH must integrate data other than the measurements performed by INAG, namely geographic data, like elevation data (DTM, slopes, aspect), hydrographic data (rivers, drainage basins, aquifers), water uses data (wells, dams, pipelines) or even administrative data which is used as a framework for analysis. In addition hydrological studies rely on the combination of time-series data and geographic data. Besides the basic needs of locating measurement stations these studies imply almost always the extrapolation of data measured in the measurement stations to larger areas. Traditional methods like Thiessen Polygons of isolines tend to be replaced by more powerful methods based on krigging.

Integration of time-series with GIS was one of the great challenges of the new version of SNIRH. ARCView2 was selected as the GIS interface, given its versatility and excelent interface, which greatly facilitates integration of new developments. A General Use Interface of SNIRH was developed based on ArcView2, which allows displaying the base maps, interactively querying SNIRH, selecting the data for analysis, for instance average rainfall in a 50 year period in 60 different rain gages in a given area of interest, and processing the data, for instance compute a rain surface using krigging and displaying the results as isolines.

The paper presents the time series object in detail, discusses the ORACLE implementation and the integration of this system with ARCView2, illustrating with on-going applications in Portugal.

Time Series, OOP, water resources, hydrology, ARCView2, ORACLE, Sather, Information System

SNIRH

The law underlying the creation of the Portuguese Water Resources
Institute, INAG, establishes as one of its responsibilities the
creation and maintenance of a Water Resources Information System,
capable of providing the data and Information required for water
resources management. In fact collecting hydrological data and
publishing it has been the responsibility of INAG' s ancestors since
the beginning of the century.

The first attempt to move from a file based system to an organized database was done in 1990, with the prototype version of SNIRH, the Water Resources Information System (Costa et al 1990). After the re-organization of the Institute the project was resumed, and it was decided to move from the prototype stage to a fully working Information system, capable of handling requests from many different users, in a network environment.

The Portuguese Water Resources Information System, SNIRH, starts in the field, collecting data on climate, hydrology and ground-water in over 1200 measurement stations in the country, and gathering data from day-to-day management tasks of the Institute. In a second stage SNIRH processes and stores those data in a complex database system. In a final stage SNIRH makes those data available to the Institute as a whole and to the outside world, providing the data analysis capabilities required to support hydrological studies and the development of water resources plans.

Thematic structure

The foundations of SNIRH are INAG' s own sources of data, either field measurements (ranging from rainfall and temperature to water levels and water quality) or its management tasks (such as issuing groundwater permits or emission licenses). However, as the ultimate goal of SNIRH is to act as a decision support system for water resources planning, it must integrate other types of data.

Past experience with the development of the Ave River Water Resources Management Plan (Costa et al 1988) and the more recent Guadiana Information System (Costa et al 1994, 1995) were the basis for the definition of the thematic structure proposed for SNIRH. This structure comprises INAG' s data on climate, surface waters, groundwater, water uses and coastal areas, see Figure 1, and support data, namely geomorphologic data and administrative data.

Climatic, surface waters and groundwater data originate mostly on measurements carried out on fixed points in space: the measurement or sampling stations. The results of measurements are time-series of continuous or discrete values, which constitute the bulk of the data stored in SNIRH. These time-series have to be processed and combined with other data to provide the Information required for water resources planning.

The Thematic Structure of SNIRH; bold lines 
represent INAG' s data; thin lines represent support data

General structure

Functional analysis

With the creation of the new version of SNIRH, INAG is reorganizing its activities around the system, using it to help with most daily tasks, rather than just doing the same old tasks using the computer instead of the hand calculator or spread-sheet. This rather ambitious goal implied a complete review of the functional analysis carried out for the development of the prototype of SNIRH developed in 1990, namely to:

i) identify and assign priorities to the tasks INAG must perform;
ii) define procedures to carry out those tasks.

The result of this process was a document, describing the system in detail, listing the main procedures and specifying the main implementation steps (INAG 1995).

Database server

Given the multiple tasks to be carried out by SNIRH it was fundamental to isolate the database storage and maintenance tasks from the data processing ones.

On the other hand given SNIRH's complexity, an open modular approach was necessary to integrate the long term goals with the need to support urgent tasks in the short term.

In order to fulfill these requirements, SNIRH was designed as a database server, continuously receiving data from many different sources, and simultaneously replying to requests from many different clients, see Figure 2.

SNIRH database server

INAG selected ORACLE as the database server; the system is installed in a network including workstations and PC's, both at the Institute and in the 5 regions around the country. The database server concept was taken as far as possible, storing at the central database not only the usual data, mostly time-series and alphanumeric, but also complex data, like images. ORACLE's Binary Large Object, BLOb, was used to support this implementation. The only data that so far are not included in the main server are maps. ArcInfo's ArcSTORM is being tested to extend the database server to the maps as well.

Interfaces

A database server is accessed through client programs. As the database server is independent of the clients, at least theoretically many different clients can be added. However to preserve the consistency of the system it is crucial to keep it as simple as possible. So the multiple tasks to be supported by SNIRH were analyzed in order to identify the interfaces needed.

It was concluded that three different interfaces were sufficient to satisfy all requirements:

After a number of tests it was concluded that Microsoft ACCESS gives all the capabilities required to develop the General Purpose Interface. ARCView2 was selected as the GIS interface, given its versatility and excellent interface, which greatly facilitates integration of new developments.

A set of guidelines for interface development were defined, which clearly specify the rules that must be complied with in the development of any SNIRH interface, ranging from attribute organization in forms, to colors and types of fields. This approach enabled various teams to work simultaneously, obtaining final results which are SNIRH-like.

Procedures

However, the ultimate goal of SNIRH is improving the technical performance of INAG. Past experience has demonstrated (Costa 1995) that delivering good tools and good training is not enough to insure better institutional performance. Two types of problems emerge:

i) professionals once trained leave the institute, and once they leave it is necessary to repeat all the training;
ii) computer based tools are quite successful at stimulating the imagination, with two different results: the final product depends on the person doing it; and it may take for ever to produce a practical result.

In order to avoid both hindrances it is necessary to define working procedures, which specify clearly how each task should be completed, using SNIRH as the basic tool. The degree of integration of the procedure into SNIRH depends on its complexity. For simple cases, like computing the rainfall over a given hydrographic basin, it may be totally built into SNIRH; for more complex cases, like validating rainfall stations, the validation steps can be built into SNIRH but expert intervention is always required.

Precise procedure definition becomes an important tool also in terms of staff training, and even for the outside world, as consulting companies get precise rules to comply with, rather than having to re-invent the wheel at high cost each time a new contract is issued. Part of the SNIRH development program includes HTML based procedure documentation, which may be consulted through the system.

The Time Series Object

As previously said, the bulk of the data stored at SNIRH originates from measurements carried out in the climatic and hydrographic networks. Examples are rainfall, temperature, evaporation, water level, Dissolved Oxygen, etc. At present there are about 1200 measurement and sampling stations in the country.

Some of these measurements are discrete, like daily rainfall or 9 a.m. temperature. These measurements can be represented as:

[(x1, t1), (x2, t2), ..., (xn, tn)]

Because these are measurements at discrete times, nothing can be said about x at time ti < tl < tk.. Other measurements are continuous, like water level in a gagging station. These measurements can be represented the same way; however, in order to know x at time tl, such that ti < tl < tk , it is enough to do an interpolation between the two values. Needless to say that in general the sampling interval is not regular:

(t1 - t2) ­ (t2 - t3) ­ (ti - ti+1)

Once having the water level measured and stored as a continuous measurement it is possible to transform it into a time-series at regular intervals, with any sampling interval compatible with the measurement device being used. It is widely recognized the relational model is quite limited in terms of dealing with this type of data.

Since the first tests in 1990 it was decided to adopt an Object Oriented Approach to the problem (Lemos et al 1989). A first version of a time-series object, TSO, was developed using C programming language, and the SNIRH prototype was developed using extensively this object. The whole formulation was revised for the new version of SNIRH, now using a fully Object Oriented Language, Sather. The time-series is treated as one more data type within ORACLE, and stored as a BLOb. Besides its data structure the TSO has built in methods to deal with time- series analysis, ranging from simple time integration methods to more sophisticated time-series analysis like filtering or smoothing.

The Water Resources Analysis Interface

The Water Resources Interface, WRI, was designed to be the day-to-day tool for hydrologic and water resources studies, ranging from resource availability analysis, to impact analysis. For instance in a first step it must allow the display of the base maps, interactively querying SNIRH, selecting the data for analysis, etc; in a second step it must allow a time-series analysis, for instance computing rainfall characteristics for a 50 year period in 60 different rain gauges in a given area; finally it must extend the results to the whole area, computing the rain surface using krigging and displaying the results as isolines. In short it must combine the GIS capability of presenting and handling maps, with the capability of manipulating time-series and extending point measurements to area results.

As it is widely recognized traditional GIS systems are not suited to deal with time varying data, and integration of time in GIS is a current area of debate (Raper 1995), so the integration of time-series with GIS was one of the great challenges of the Water Resources Interface. The solution implemented tackles only the case of point measurements, although it is believed that the same Principles will apply to area measurements (like for instance remote sensing).

Existing alternatives for this interface can be clustered into two groups:

A prototype XWindows interface was developed in 1991; a second prototype was developed in 1994 combining a Motif Control Panel and integrating GRASS as the GIS engine. A thorough analysis of the results and the man-power required to move from a prototype stage to a fully reliable system clearly indicated that it was not possible or worth to compete with extremely refined mapping applications like ArcView2. So it was decided that rather than creating a new application it was more effective to concentrate on specific add-ons.

The solution implemented is based on three principles:

i) time-series are autonomous, so they may be analyzed independently of any GIS interface;
ii) time-series are measurements carried out at given points in space, so they may be analyzed within a geographical context;
iii) measurement stations yield values of a complex surface of the phenomena under analysis, it must be possible to extrapolate this surface, based on the single point values, using appropriate surface estimation methods, ranging from Voronoi Thessalation to Krigging.

In practice the WRI is a combination of a Time-Series Analysis application with ArcView2, see Figure 3. The Time-Series application has 3 main windows:

Typically the user starts with the analysis of the location of the measurement stations in ArcView2, using general browsing tools and specific procedures already develop, selects the area of interest and pushes the time-series button. The time-series browser is displayed, and the set of measurement stations selected in ArcView2 is displayed, as well as all the time-series available in SNIRH for the period under analysis.

In a second stage of time-series processing the user may work in the time-series windows alone. When the final results for the measurement stations are obtained it may be necessary to extrapolate them to the whole area. ArcInfo is used as a map processing server and the final results displayed in ArcView2.

The Water Resource Analysis Interface

Future and Conclusions

SNIRH is operational and most hydrologic data available at INAG is stored and easily accessible. As any live information system SNIRH is never finished: new areas are being added as well as new processing capabilities. The following developments are planned for the next two years:


References

COSTA, J.R. et al. 1988 - Metodolgias para a Avaliao de Politicas de Recursos Hdricos- Plano de Gest‹o dos Recursos H’dricos da Bacia do Rio Ave. (Methodologies for Water Resources Policy Analysis - The Ave River Management Plan). Laborat—rio Nacional de Engenharia Civil, Lisboa, 1988.

COSTA, J.R. et al. 1988 - Metodolgias para a Avaliao de Politicas de Recursos Hdricos- Plano de Gesto dos Recursos Hdricos da Bacia do Rio Ave. (Methodologies for Water Resources Policy Analysis - The Ave River Management Plan). Laboratrio Nacional de Engenharia Civil, Lisboa, 1988.

Costa, J.R., Cunha, L.A., Santos, M.A., Loureiro, J.M., Santos, J.B., Maio, C.R., Neves, J.R., Gomes, A.C. 1990 - Sistema Nacional de Informao sobre.

Recursos Hdricos - SNIRH, definio e estruturao. Relatrio UNINOVA/DGRN.

Costa, J.R., Jesus, H.B., Fonseca, V. 1994 - The role of GIS in environmental planning: the Guadiana case
Costa, J.R., Jesus, H.B., Fonseca, V., Seabra, C. 1994 - COVEPLAM: A GIS based methodology for water quality management in Mediterranean Areas. Comunicao ao EGIS Conference, Paris 1995. 10 pp.

Costa, J.R. 1995 - An outsider in decision making: implementation of GIS in complex environments. Keynote paper EGIS conference the Hague, March 1995.

Fedra, K. 1993 - GIS and environmental modeling. In Environmental Modelling with GIS, Ed. by Goodchild, M.; Parks, B.; Steyaert, L. Oxford University Press, 1993.

INAG 1995 - SNIRH: the Water Resources Information System. INAG, Portugal. Lemos, L.; Violante, A.; Costa, J.C.; Ford, D.; Oliveira, R. 1989 - A time-Series Object for Water Resources Information Systems. Lisbon, Portugal, UNINOVA-GAS.

Loucks, Costa 1991 - Decision Support Systems: water resources planning. Springer-Verlag.

Keywords

Time Series, OOP, water resources, hydrology, ARCView2, ORACLE, Sather, Information System.


Author Information

Joao Ribeiro da Costa, Professor
New University of Lisbon
Quinta da Torre
Monte de Caparica 2825, Portugal
Email: jrc@uninova.pt
Fax: 351- 1- 2957786

M. Lacerda
INAG
National Water Institute
Av. Gago Coutinho
Lisboa 1000, Portugal

H.B. Jesus
UNINOVA
Quinta da Torre
Monte de Caparica 2825, Portugal
Email: hbj@uninova.pt