hdist {transfR} | R Documentation |
Geographical distance between catchments
Description
Calculate distances between two sets of catchments using their spatial support.
Usage
hdist(x, y, ...)
## S3 method for class 'sfc'
hdist(
x,
y,
method = "rghosh",
gres = 5,
ditself = FALSE,
maxsample = 25000,
proj = NULL,
parallel = FALSE,
cores = NULL,
verbose = TRUE,
...
)
## S3 method for class 'sf'
hdist(x, y, ...)
## S3 method for class 'stars'
hdist(x, y, ...)
## S3 method for class 'transfR'
hdist(x, y, method = "rghosh", weightO = 0.8, weightC = 0.2, ...)
Arguments
x |
sf, stars or transfR object of the first catchments |
y |
sf, stars or transfR object of the second catchments |
... |
further arguments passed to or from other methods |
method |
the method to use for computing distance. This must be one of "ghosh", "rghosh", "points", "centroids", "combined" |
gres |
resolution of spatial discretisation (number of points by km²) for Ghosh distance |
ditself |
logical value indicating if the distance to itself should be computed. It will add one row and one column in the distance matrix. Only used if method is "ghosh" |
maxsample |
maximum size of sampling points for each catchments during spatial discretisation |
proj |
logical indicating if spatial layer are using a projection. If TRUE, euclidean distance is used. If FALSE, the great-circle distance is used |
parallel |
logical indicating if the computation should be parallelised |
cores |
the number of cores to use for parallel execution if |
verbose |
boolean indicating if information messages should be written to the console |
weightO |
weight given to the distance between outlets if method is "combined" |
weightC |
weight given to the distance between centroids if method is "combined" |
Details
The method
"ghosh" refers to a simplification of the distance defined
by Ghosh (1951) as proposed by Gottschalk (1993); Gottschalk et al. (2011).
The rescaled Ghosh distance (method
"rghosh") is calculted following de Lavenne et al. (2016).
Value
A matrix of class units with the catchments of x
organised in rows
and the catchments of y
organised in columns.
References
Ghosh B (1951). “Random distances within a rectangle and between two rectangles.” Bull. Calcutta Math. Soc, 43(1), 17–24.
Gottschalk L (1993). “Interpolation of runoff applying objective methods.” Stochastic Hydrology and Hydraulics, 7(4), 269–281. doi:10.1007/BF01581615.
Gottschalk L, Leblois E, Skøien JO (2011). “Distance measures for hydrological data having a support.” J. Hydrol., 402(3-4), 415–421. doi:10.1016/j.jhydrol.2011.03.020.
de Lavenne A, Skøien JO, Cudennec C, Curie F, Moatar F (2016). “Transferring measured discharge time series: Large-scale comparison of Top-kriging to geomorphology-based inverse modeling.” Water Resources Research, 52(7), 5555–5576. doi:10.1002/2016WR018716.
Examples
data(Oudon)
catchments <- st_geometry(Oudon$obs)
hdist(x = catchments[1:2], y = catchments[3:5], gres = 5, method = "rghosh")