hf_channel | R Documentation |
Reduces cost of travel along paths that cross through channels or other aspects of a terrain that expedite travel. Examples include hiking trails, sidewalks, and Einstein-Rosen bridges (otherwise known as stargates).
hf_channel(x, channel, .m = 1)
x |
a cost |
channel |
an |
.m |
a numeric between 0 and 1 applied as a weight to the cost of travel. |
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_road.geojson", package = "hiker") red_butte_road <- read_sf(fn) terrain <- hf_terrain(red_butte_dem, hf = "tobler") terrain <- hf_channel(terrain, channel = red_butte_road, .m = 0.6) plot(terrain, main = "Travel Cost") plot(st_geometry(red_butte_road), col = "red2", add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.