hf_barrier | R Documentation |
Prevents travel along paths that cross through barriers or other obstacles that cannot be traversed, like a river, a Greek phalanx, or "the Wall".
hf_barrier(x, barrier)
x |
a cost |
barrier |
an |
a terrain
representing cost of travel.
library(sf) library(terra) fn <- system.file("extdata/red_butte_dem.tif", package = "hiker") red_butte_dem <- rast(fn) fn <- system.file("extdata/red_butte_reservoir.geojson", package = "hiker") red_butte_reservoir <- read_sf(fn) terrain <- hf_terrain(red_butte_dem) terrain <- hf_barrier(terrain, red_butte_reservoir) plot(terrain, main = "Travel Cost") plot(st_geometry(red_butte_reservoir), col = NA, border = "red2", add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.