Elsevier

Computers & Geosciences

Volume 67, June 2014, Pages 180-190
Computers & Geosciences

rtop: An R package for interpolation of data with a variable spatial support, with an example from river networks

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

Highlights

  • R package for geostatistical interpolation of observations with a support.

  • Consistent predictions along stream networks.

  • Methods for exploratory data analysis.

Abstract

Geostatistical methods have been applied only to a limited extent for spatial interpolation in applications where the observations have an irregular support, such as runoff characteristics along a river network and population health data. Several studies have shown the potential of such methods, but these developments have so far not led to easily accessible, versatile, easy to apply and open source software. Based on the top-kriging approach suggested by Skøien et al. (2006), we will here present the package rtop, which has been implemented in the statistical environment R (R Core Team, 2013). Taking advantage of the existing methods in R for analysis of spatial objects (Bivand et al., 2013), and the extensive possibilities for visualizing the results, rtop makes it easy to apply geostatistical interpolation methods when observations have a non-point spatial support. The package also offers integration with the intamap package for automatic interpolation and the possibility to run rtop through a Web Service.

Introduction

For many applications where a process has been observed, it is also necessary to have predictions of the process at locations without observations; this could be for visualization purposes, for input in a different model, or for further analysis. There exists an appealing set of methods for such predictions, based on a model of spatial correlation between random variables defined at observation and prediction locations. These are commonly referred to as geostatistical methods (Isaaks and Srivastava, 1989) due to the background from mining, although similar methods were also developed within meteorology (Gandin, 1963) and referred to as objective methods. Kriging is defined as the best linear unbiased estimator for spatial data, i.e. a linear interpolation method where the expected bias is zero and the expected interpolation error is minimized. One major advantage of these methods is that they can give an estimate of the prediction uncertainty in addition to the prediction itself.

Whereas geostatistical and similar methods mostly have been developed for and applied to observations with point support or a regular support (e.g. pixels from satellite images), and also to make predictions for areas or volumes (Journel and Huijbregts, 1978), many data sources have a more irregular support in time and/or space, such as runoff related data and aggregated health data. The literature shows some different approaches to solve the interpolation problem for observations with non-point support (Goovaerts, 2006, Goovaerts, 2008, Gottschalk, 1993, Gottschalk et al., 2006, Gotway and Young, 2002, Kyriakidis, 2004, Sauquet et al., 2000, Skøien et al., 2006). Although all these studies make similar assumptions and solve the problem in a similar way, there has not yet been any easily accessible, easily applicable and open source software that is able to interpolate such data.

Based on the top-kriging approach suggested in Skøien et al. (2006), and extended with suggestions by Gottschalk (1993) and Gottschalk et al. (2011), we present the package rtop, which has been implemented in the open source statistical environment R (R Core Team, 2013). The R environment includes a large range of tools for data analysis and visualization and is a platform where it is easy to extend the existing system with new methods in a package system. Several packages already deal with spatial data within R (Bivand et al., 2013), but none of these can do geostatistical interpolation with a variable spatial support of observations taken into account. rtop therefore makes it considerably easier to do such interpolation and to use visualize results, in comparison to former implementations of the method. And although the top-kriging method was originally developed for interpolation of runoff characteristics, we also suggest that the package can be useful for a number of other analyses such as health statistics from administrative regions, aggregated forest data and remote sensing images.

There are several other R-packages that can do some similar operations. The dissever-package (Malone et al., 2012) can for example do downscaling of remote sensing images, but it is based on regular areas and is not available on CRAN. The SSN-package (VerHoef and Peterson, 2010) is able to do interpolation along stream networks, but this is based on a different theory which does not take the areal support into account. It also requires preprocessing of the stream network with the STARS geoprocessing toolset running under ArcGIS.

The constrainedKriging-package (Hofer and Papritz, 2011) can do interpolation to irregular blocks, but not from observations with irregular supports, and does not include variogram fitting tools comparable to rtop. It is also possible to make extensions to the gstat-package (Pebesma, 2004) for interpolation between different supports, but this is currently not in the code itself, and it is not possible to fit variograms for such observations. It is also likely that the framework of the INLA-package (Rue et al., 2013) can deal with the same type of problems as rtop, but such functionality has, to our knowledge, not yet been implemented. Also the C-code of the psgp-package (Barillec et al., 2011) can in theory interpolate observations and predictions with a spatial support, but this is not available from the R-package.

rtop is currently the only package which provides all necessary functionality for interpolating data with variable spatial support. In this paper we demonstrate the package with an example from hydrology: the interpolation of streamflow along river networks, where it was earlier necessary to combine the use of spreadsheets, analyses tools, graphical tools and GIS to perform the interpolation. We show how rtop can be applied to carry out this chain of analyses within R, to get an easy solution for the river network problem and other problems of spatial interpolation with a variable support.

Section snippets

Theory

The rtop package is based on the top-kriging method presented by Skøien et al. (2006), but also includes simplifications suggested by Gottschalk (1993). The theoretical background of top-kriging is briefly described below, with some additions regarding validity.

The rtop package

The new package rtop is based on a reimplementation of the top-kriging method presented by Skøien et al. (2006) in the statistical language/environment R (R Core Team, 2013). The original implementation was in FORTRAN, whereas the rtop package is almost entirely implemented as R code. Some computationally demanding functions have been kept in FORTRAN for faster computation. The main functions have been implemented using the S3 object handling of R, making it easier to use the same functions for

Example

In the example application we use top-kriging for prediction of a hydrologic characteristic (average summer runoff) along river networks in the federal country of Upper Austria. The average summer runoff is interpolated from the gauge locations to locations on the river where runoff measurements were absent. The top-kriging approach is applicable if we assume that the average runoff is a linear aggregate of all runoffs generated within the upstream contributing area. Runoff prediction at

Conclusions

An R package for interpolating observations with a non-point support has been developed. This package is easy to use, is an open source, and is developed within the R environment, which can handle a large range of formats of input and output, and simplifies creation of graphical output and diagnostics. The versatility of R makes it possible to make most, if not all, of the analyses within one framework, where it was earlier necessary to exchange data between spreadsheets, visualization tools,

Acknowledgements

We would like to thank two anonymous reviewers for their constructive comments and suggestions which helped to improve the quality of this manuscript.

References (37)

  • N. Cressie

    Fitting variogram models by weighted least squares

    Math. Geol.

    (1985)
  • N. Cressie

    Statistics for Spatial Data

    (1991)
  • G. de Marsily

    Quantitative Hydrogeology

    (1986)
  • Q. Duan et al.

    Effective and efficient global optimization for conceptual rainfall-runoff models

    Water Resour. Res.

    (1992)
  • Gandin, L.S., 1963. Objective Analysis of Meteorological Fields (in Russian). Gidrometeorologicheskoe Izdate׳stvo,...
  • B. Ghosh

    Random distances within a rectangle and between two rectangles

    Bull. Calcutta Math. Soc.

    (1951)
  • Goovaerts, P., 2006. Geostatistical analysis of disease data: accounting for spatial support and population density in...
  • P. Goovaerts

    Kriging and semivariogram deconvolution in the presence of irregular geographical units

    Math. Geosci.

    (2008)
  • Cited by (43)

    • Regionalisation procedures - estimation at the ungauged site

      2023, Hydrological Drought: Processes and Estimation Methods for Streamflow and Groundwater, Second Edition
    • The transfR toolbox for transferring observed streamflow series to ungauged basins based on their hydrogeomorphology

      2023, Environmental Modelling and Software
      Citation Excerpt :

      They essentially rely on geostatistical spatial interpolation (Skøien and Blöschl, 2007; Isaak et al., 2014; Müller and Thompson, 2015; Farmer, 2016), transformation functions applied to hydrographs (Andréassian et al., 2012), or hydraulic routing (Tewolde and Smithers, 2007; Song et al., 2011). Some of these approaches were complemented by the development of R packages such as rtop (Skøien et al., 2014) and atakrig (Hu and Huang, 2020). In comparison with the rainfall–runoff approach, runoff–runoff modelling approaches do not require an explicit modelling of the hydrological response to meteorological forcing data.

    • Coupling a pathway-oriented approach with tailor-made monitoring as key to well-performing regionalized modelling of PFAS emissions and river concentrations

      2022, Science of the Total Environment
      Citation Excerpt :

      As the network of river gauges is quite dense in Austria, Bavaria and Switzerland, a geostatistical approach called Top-kriging, developed by Skøien et al. (2006), was applied by Weber (2020) to generate this data set. Weber (2020) extended the Top-kriging approach available as an R package (Skøien et al., 2014) to consider the numerous trans-catchment diversions in the Alps. The final data set of net runoff contains a small but systematic bias (cp.

    View all citing articles on Scopus
    View full text