Geo-visualization Fortran library

https://doi.org/10.1016/j.cageo.2010.04.012Get rights and content

Abstract

Geobrowser tools offer easy access to geographical and map images over which geospatial data can be overlaid, a process that provides a powerful new visualization resource for scientists. Many of these tools make use of the well-documented KML/XML data formats, and the challenge for the scientist is to generate KML files from their simulation and analysis programs. Since many of these programs are written in the Fortran language, which does not have native tools to support XML files, we have developed a new library – WKML – that enables KML files to be produced directly and automatically. This paper describes the WKML library, gives a number of different examples to illustrate the breadth of its functionality, and describes in more detail an example of its use for hydrology.

Introduction

The recent development of geobrowser tools that provide free and easy access to high-quality maps and high-resolution aerial photographs of land have revolutionized the way in which researchers can visualize geospatial data. Not only are researchers able to use these tools in their own data analysis tasks, but they can create representations that allow them to present information to their collaborators or the wider public.

Many geobrowser tools (e.g. Google Earth, ArcGIS Explorer, NASA World Wind) will accept geospatial data represented using the Keyhole Markup Language (KML) (Wernecke, 2009), an XML-based language. KML is able to describe various primitive elements, such as points, lines and polygons, with specific geographical information. For example, a point can be represented using the following relatively simple piece of code:

Although this code looks straightforward, a file with many data points (and with more complex primitives) might normally be expected to be generated automatically as an output from a simulation or data analysis program. Many (or even most) numerical and simulation computer programs used in several branches of science – including climate, atmosphere, ocean, and hydrology models – are written using the Fortran language, and there are a number of reasons why it would be useful to have a library to support writing XML in general, and KML specifically, from Fortran programs. Briefly, some of these reasons are:

  • 1.

    To make it easy to write XML/KML documents from a Fortran program, reducing the burden on the programmer in terms of the amount of coding and familiarity with XML and KML required. This is not to imply that programmers should not need to know anything at all about KML/XML, but essentially all they need to know is the broad general ideas. Moreover, there is no reason why a programmer should need to know about issues such as namespaces (as represented by the line <kml xmlns=...> in Listing 1).

  • 2.

    To enable additional content, such as contour maps, which are not included in KML, to be automatically generated from programs.

  • 3.

    For the generation of KML documents to be automatic from within a simulation program. The reader might question whether it would instead have been better to focus on writing a program that would parse a general output file into KML using a more natural programming language. Whilst this is possible, it would put an additional burden on the code developer (not least because he/she would need to generate this tool, and parsing tools require some effort for them to be made robust), and would require the end user to run an additional program.

For these reasons we have created a library of subroutines to enable easy generation of KML files from within Fortran programs; the purpose of this paper is to provide a wide-ranging introduction to its use.

We have previously developed the Fortran library “FoX” – Fortran XML (White et al., 2006a, White et al., 2006b, White et al., 2009) – to support writing XML from Fortran 95 programs.1 For particular XML languages, we have developed specific libraries that provide more powerful language-specific subroutine calls. For example, much of our earlier work was concerned with the Chemical Markup Language (CML; White et al., 2006a, White et al., 2006b, White et al., 2009), and we developed a set of subroutines within the FoX library that automatically impose the appropriate syntax required by CML (WCML, “Writing CML”). This has been demonstrated to be extremely useful in the chemical simulation sciences to quickly add CML output capabilities to existing codes (Salje et al., 2009). The FoX library (Dove, 2009) is available as a download package, free of charge for anyone.

Based on our experience with FoX and WCML we have developed another FoX library called WKML (“Writing KML”) to enable KML output to be produced by Fortran codes, and the purpose of this paper is to describe this library and to give a case study to illustrate its value. In anticipation of the description that follows later in this paper, and to set the scene, the small KML file shown above (Listing 1) would be written using the following WKML library calls within a Fortran program: What should be clear from this example is:

  • 1.

    No part of the program needed an awareness of the syntax of KML.

  • 2.

    The writing of the latitude and longitude points required one simple subroutine call (kmlAddPoints), which clearly makes for condensed code when this process is repeated often in a program.

  • 3.

    The subroutine calls kmlBeginFile and kmlFinishFile handle the correct beginning and ending of the KML file, again without requiring the programmer to know what XML/KML expects.

Grid computing, as a general framework, is being adopted more and more by the Earth and Environmental Sciences communities worldwide (Renard and Badoux, 2009). Examples include the use of eScience approaches in Earth System modeling (Lenton et al., 2009), oceanographic modeling (Holt et al., 2009), geology (Gahegana et al., 2009), mineral physics (Salje et al., 2009), climate modeling (Frame et al., 2009), and simulations of natural hazards (Bovolo et al., 2009). Grid computing for hydrological applications, however, is still a relatively new field.

Grid computing can be a valuable resource for hydrology, particularly since it is well-suited for computationally intensive applications such as large-scale parameter sweeps, sensitivity studies and uncertainty analysis, and for multiple scenario applications such as looking at the impacts of land-use change or future climate change on the hydrology of a catchment. Such virtual experiments, by their very nature, generate large number of simulations and hence vast amounts of data, which in turn require efficient data handling and metadata management tools, together with ways to visualize and capture relevant outputs. Simple visualization tools such as Google Earth, are particularly useful, as they allow geospatial, graphical and animated outputs to be viewed in a freely available, easy to use, dynamic, interactive environment on the user's desktop.

Our work on WKML has arisen from realising that the use of XML for data representation can play an important role in aiding data interoperability (White et al., 2006a, White et al., 2006b). The e Minerals project (Salje et al., 2009) developed the FoX toolkit for the use of XML in grid computing, enabling automatic collaborative exchange of information, metadata collection through using Xpath expressions coupled with the e Minerals RCommands system (Tyer et al., 2006, Tyer et al., 2007) and data analysis. In the development of the new WKML library for writing KML, we envisage that this will facilitate, in particular, the ability of collaborating researchers to share results with each other and with a wider public. This may include communities involved in setting policies and those who are subsequently affected.

In the next section of this paper we will build upon this introduction to give a more detailed description of some of the key features of WKML together with some simple examples. Following this we will describe a case study from the field of hydrology, but the reader should appreciate that nothing within WKML prohibits application in any other field of science that uses geospatial data or information. In the use case described here we actually focus on the visualizations of outputs using WKML and its benefits, and the associated eScience infrastructure, rather than on the scientific aims and results.

Section snippets

General principles

The introduction described the main design requirement behind WKML, namely is that it should make creation of KML files as easy and intuitive as possible from within Fortran programs. The target audience is the Fortran programmer who wants to be able to generate KML files but who is not necessarily an expert in KML. Thus our main aim has been to create a set of subroutines that can be called in a style that likely best matches the thought processes of the scientist programmer, with usability

The SHETRAN hydrological modeling program

SHETRAN (Ewen et al., 2000, Ewen et al., 2002) is a three-dimensional (ie including the surface and subsurface structures) physically based hydrology simulation program, which uses a spatially distributed finite difference model to simulate coupled water flow, multifraction sediment transport and multiple reactive solute transport in river basins. It is capable of modeling all phases of the hydrological cycle. Water flow can be simulated following temporal and spatial varying rainfall patterns

Discussion

In this paper we have described the WKML library for producing KML files as outputs from Fortran programs suitable for viewing using a geobrowser client tool. Our motivation has been to make this process as easy as possible for the Fortran programmer, reducing the need for the programmer to know about the syntax of KML or XML. Instead all the programmer needs to know is the format of some subroutine calls, which have been designed to be as intuitive as possible. We have illustrated some of the

Acknowledgement

We are pleased to acknowledge funding from NERC (UK) for this work.

References (26)

  • C.I. Bovolo et al.

    A distributed framework for multi-risk assessment of natural hazards used to model the effects of forest fire on hydrology and sediment yield

    Computers & Geosciences

    (2009)
  • Chiang, G.-T., White, T.O.H., Dove, M.T., 2007. Driving Google Earth from Fortran. In: Proceedings of the UK e-Science...
  • G.-T. Chiang et al.

    Geospatial visualization tool kit for scientists using Fortran

    Eos

    (2009)
  • Crawford, D., 2010. Gnuplot 4.4—an interactive plotting program 〈http://www.gnuplot.info/docs/gnuplot.html, accessed...
  • Dove, M.T., Walker, A.M., White, T.O.H., Bruin, R.P., Austen, K.F., Frame, I., Chiang, G.-T., Murray-Rust, P., Tyer,...
  • Dove, M.T., FoX and Fortran 〈http://web.esc.cam.ac.uk/xml/fox.html〉, accessed April 21,...
  • J. Ewen et al.

    SHETRAN: physically-based distributed river basin modelling system

  • J. Ewen et al.

    SHETRAN: distributed river basin flow and transport modeling system

    American Society of Civil Engineers Journal of Hydrologic Engineering

    (2000)
  • D.J. Frame et al.

    The climateprediction.net BBC climate change experiment: design of the coupled model ensemble

    Philosophical Transactions of the Royal Society A

    (2009)
  • M. Gahegana et al.

    Connecting GEON: making sense of the myriad resources, researchers and concepts that comprise a geoscience cyberinfrastructure

    Computers & Geosciences

    (2009)
  • Google, 2010. Google Chart Tool 〈http://code.google.com/apis/charttools/〉, accessed April 21,...
  • J. Holt et al.

    Modelling the global coastal ocean

    Philosophical Transactions of the Royal Society A

    (2009)
  • T.M. Lenton et al.

    Using GENIE to study a tipping point in the climate system

    Philosophical Transactions of the Royal Society A

    (2009)
  • Cited by (7)

    • Applications and impacts of Google Earth: A decadal review (2006–2016)

      2018, ISPRS Journal of Photogrammetry and Remote Sensing
      Citation Excerpt :

      The extensible functionality of KML has proven very helpful for visualizing complex structures and dynamic processes in geoscience, as well as for data sharing (Sun et al., 2012 ). In a special issue (Virtual Globes in Science) with 11 articles published in Computers & Geosciences, 7 articles were centered around the utilization of KML for geovisualization (Smith and Lakshmanan, 2011; Webley, 2011; Chien et al., 2011; Postpischl et al., 2011; Ballagh et al., 2011; Chiang et al., 2011; Tomaszewski, 2011; Heavner et al., 2011). 3D Visualization of large-scale time-varying geo-scientific data and geo-processes is challenging for scientists.

    • 3D geological modeling and visualization of rock masses based on Google Earth: A case study

      2013, 2013 5th International Conference on Computer Science and Information Technology, CSIT 2013 - Proceedings
    View all citing articles on Scopus
    View full text