if (FALSE) { # interactive() && traudem::can_register_taudem()
# \donttest{
fp <- system.file("extdata/wigger.tif", package = "rivnet")
r <- extract_river(outlet = c(637478, 237413),
DEM = fp)
r <- aggregate_river(r)
X <- 641329; Y <- 227414
out1 <- locate_site(X, Y, r, showPlot = TRUE) # as the crow flies
out2 <- locate_site(X, Y, r, showPlot = TRUE, euclidean = FALSE) # follow downstream path
# }
# define X, Y by clicking on the map
if (interactive()) {
fp <- system.file("extdata/wigger.tif", package = "rivnet")
r <- extract_river(outlet = c(637478, 237413),
DEM = fp)
r <- aggregate_river(r)
plot(r)
point <- locator(1) # click on the map to define point
locate_site(point$X, point$Y, r)
# alternative: specify X as a list and pass river as second argument
locate_site(point, r)
}
}
Run the code above in your browser using DataLab