Proposal of a Python interface to OpenMI, as the base for open source hydrological framework

Robert Szczepanek


Hydrologists need simple, yet powerful, open source framework for developing and testing mathematical models. Such framework should ensure long-term interoperability and high scalability. This can be done by implementation of the existing, already tested standards. At the moment two interesting options exist: Open Modelling Interface (OpenMI) and Object Modeling System (OMS). OpenMI was developed within the Fifth European Framework Programme for integrated watershed management, described in the Water Framework Directive. OpenMI interfaces are available for the C# and Java programming languages. OpenMI Association is now in the process of agreement with Open Geospatial Consortium (OGC), so the spatial standards existing in OpenMI 2.0 should be better implemented in the future. The OMS project is pure Java, object-oriented modeling framework coordinated by the U.S. Department of Agriculture. Big advantage of OMS compared to OpenMI is its simplicity of implementation. On the other hand, OpenMI seems to be more powerful and better suited for hydrological models. Finally, OpenMI model was selected as the base interface for the proposed open source hydrological framework.  The existing hydrological libraries and models focus usually on just one GIS package (HydroFOSS – GRASS) or one operating system (HydroDesktop – Microsoft Windows). The new hydrological framework should break those limitations. To make hydrological models’ implementation as easy as possible, the framework should be based on a simple, high-level computer language. Low and mid-level languages, like Java (SEXTANTE) or C (GRASS, SAGA) were excluded, as too complicated for regular hydrologist. From popular, high-level languages, Python seems to be a good choice. Leading GIS desktop applications – GRASS and QGIS – use Python as second native language, providing well documented API. This way, a Python-based hydrological library could be easily integrated with any GIS package supporting this programming language. As the OpenMI 2.0 standard supported interfaces only for Java and C#, the Python interface for OpenMI standard, presented in this paper, is the first step done towards the open and interoperable hydrological framework. GIS-related issues of the OpenMI 2.0 standard are also outlined and discussed.


hydrological framework, Python, OpenMI, open source, Water Framework Directive


Ames, D. P., Horsburgh, J., Goodall, J., Whiteaker, T., Tarboton, D. and Maidment, D. (2009). Introducing the Open Source CUAHSI Hydrologic Information System Desktop Application (HIS Desktop), 18th World IMACS/MODSIM Congress, Cairns, Australia.

Belger, G., Haase, M., Jung, T. and Lippert, K., (2009). A GIS-based Platform for Environmental and Water Resources Modeling – Kalypso Open Source, GEO Informatics magazine.

Bergstra, J., Breuleux, O., Bastien, F., Lamblin, P., Pascanu, R., Desjardins, G., Turian, J., Warde-Farley, D. and Bengio, Y., (2010). Theano: A CPU and GPU Math Expression Compiler. Proceedings of the Python for Scientific Computing Conference (SciPy) 2010. Austin, TX

Beven, K.J., Lamb, R., Quinn, P., Romanowicz, R. and Freer, J. (1995). TOPMODEL, in Computer Models of Watershed Hydrology, Singh V.P. (Ed.), Water Resources Publications, 627-668.

Cannata , M., (2006). A GIS embedded approach for Free & Open Source Hydrological Modelling, PhD dissertation, Politecnico di Milano.

Croke, B.F.W., Andrews, F., Jakeman, A.J., Cuddy, S. and Luddy, A., (2005). Redesign of the IHACRES rainfall-runoff model, Proceedings of the 29th Hydrology and Water Resources Symposium, Engineers Australia

David, O. and Krause, P., (2002). Using the Object Modelling System for future proof of hydrological model development and application. Proceedings of the Second Federal Interagency Hydrologic Modeling Conference, Las Vegas, NV, July 28 – August 2, 621626.

David, O., Ascough II, J., Leavesley, G., and Ahuja, L., (2010). Rethinking modeling framework design: Object Modeling System 3.0. IEMSS 2010 International Congress on Environmental Modeling and Software – Modeling for Environment’s Sake, Fifth Biennial Meeting, July 5-8, 2010, Ottawa, Canada; Swayne, Yang, Voinov, Rizzoli, and Filatova (Eds.)

Donnelly, F.P., (2010). Evaluating open source GIS for libraries, Library Hi Tech, Vol. 28 Iss: 1, 131-151.

Gregersen, J.B., Gijsbers P.J.A. and Westen S.J.P. (2007). OpenMI: Open Modelling Interface. Journal of Hydroinformatics 9(3), 175-191.

Harou, J., Pinte, D., Hansen, K., Rosenberg, D., Tilmant, A., Medellin-Azuara, J., Pulido-Velazquez, M., Rheinheimer, D., Matrosov, E., Reynaud, A., Kock, B., and Vicuna, S., (2009). – an open-source generic software interface and web repository for water management models. International Symposium on Environmental Software Systems, ISESS 2009, Venice, Italy.

Hengl, T., Grohmann, C.H., Bivand, R.S., Conrad, O. and Lobo, A., (2009). SAGA vs GRASS: A Comparative Analysis of the Two Open Source Desktop GIS for the Automated Analysis of Elevation Data. Geomorphometry 2009 Conference Proceedings, In: Geomorphometry 2009, Edited by R. Purves, S. Gruber, R. Straumann and T. Hengl. University of Zurich, Zurich, 22-27.

Inglada, J. and Christophe, E., (2009). The Orfeo Toolbox remote sensing image processing software, Geosciences and Remote Sensin Symposium, 2009 IEEE International, IGARSS 2009, Cape Town, IV 733-736.

jgrasstools project, Available at:

Kopp, S.M., (1996). Linking GIS and hydrological models: where we have been, where we are going? Proceedings og HydroGIS 96: Application of Geographic Information Systems in Hydrology and Water Resources. IAHS Publ. no.235. 133-139.

Lindström, G., Pers, C.P., Rosberg, R., Strömqvist, J. and Arheimer, B, (2010). Development and test of the HYPE (Hydrological Predictions for the Environment) model – A water quality model for different spatial scales. Hydrology Research 41.3-4:295-319.

Lu, B. and Piasecki, M., (2008). Development of an Integrated Hydrologic Modeling System for Rainfall-Runoff Simulation, American Geophysical Union, Fall Meeting 2008, abstract #H41G-0953, Available at:

Neteler, M., Bowman, M.H., Landa, M. and Metz, M., (2012). GRASS GIS: A multipurpose open source GIS. Environmental Modelling & Software.

Object Modeling System (OMS) project, (2011). Available at:

OGC, (2002). The OpenGIS Abstract Specification Topic 2: Spatial referencing by Coordinates OGC 01-063r2, OpenGIS Consortium Inc.

OGC, (2012). OGC Glossary, Available at:

Olaya, V., (2012). SEXTANTE – Spatial Data Analysis Library, Available at:

Olaya, V. and Gimenez, J.C., (2011). SEXTANTE, a versatile open–source library for spatial data analysis.

The OpenMI Association, (2010). OpenMI Standard 2 Reference for the OpenMI (Version 2.0). Part of the OpenMI Document Series.

The OpenMI Association, (2010). Scope for the OpenMI (version 2.0). Part of the OpenMI report series.

The OpenMI Association, (2010). OpenMI Standard 2 Specification for the OpenMI (Version 2.0). Part of the OpenMI Document Series.

Ozga-Zielińska, M., Gadek, W., Ksiażyński, K., Nachlik, E. and Szczepanek R., (2002). Mathematical model of rainfall-runoff transformation – WISTOO, Mathematical Models of Large Watershed Hydrology, Ed. V.P.Singh, D.K.Frevert, Water Resources Publications, 811-860.

Poveda, G., Mesa, O. J. and Velez, J. I., (2007). HidroSIG: An interactive digital atlas of Colombia’s hydro-climatology, Journal of Hydroinformatics, 9 (2), 145-156.

Quantum GIS Development Team, (2011). Quantum GIS Geographic Information System. Open Source Geospatial Foundation Project. Available at:

Rewerts, C.C. and Engel, B.A., (1993). ANSWERS on GRASS: Integration of a watershed simulation with a geographic information system. Abstracts, Proc., 8th Annu. GRASS GIS User’s Conf. and Exhibition.

Rey, S.J., (2008). Show Me the Code: Spatial Analysis and Open Source, unpublished, Available at:

Rigon, R., Bertoldi, G. and Over, T. M., (2006). GEOtop: A Distributed Hydrological Model with Coupled Water and Energy Budgets., Journal of Hydrometeorology, Vol. 7, No. 3, 371-388.

Schiffers, M., Kranzlmuller, D., Clematis, A., D’Agostino, D., Galizia, A., Quarati, A., Parodi, A., Morando, M., Rebora, N., Trasforini, E., Molini, L., Siccardi, F., Craig, G.C. and Tafferner, A., (2011). Towards a grid infrastructure for hydro-meteorological research, Computer Science, Vol. 12, 45-62.

Schröder, D., Hildahb, M. and David, F., (2010). Evaluation of gvSIG and SEXTANTE Tools for Hydrological Analysis. 6th International gvSIG Conference. Available at:

Tarboton, D. G. and Baker, M.E., (2008). Towards an Algebra for Terrain-Based Flow Analysis, in Representing, Modeling and Visualizing the Natural Environment: Innovations in GIS 13, Edited by N. J. Mount, G. L. Harvey, P. Aplin and G. Priestnall, CRC Press, Florida.

Tsou, M.H. and Smith, J., (2011). Free and Open Source Software for GIS education, Department of Geography, San Diego State University, (white paper)

Yizhong, Q., (2004). An integrated hydrologic model for multi-process simulation using semi-discrete finite volume approach, PhD Thesis, The Pennsylvania State University. Available at:


  • There are currently no refbacks.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.