View source: R/create_cost_corridor.R
create_cost_corridor | R Documentation |
Combines and averages the accumulated cost surfaces from origin-to-destination and destination-to-origin to identify areas of preferential movement that takes into account both directions of movement
create_cost_corridor(x, origin, destination, rescale = FALSE)
x |
|
origin |
|
destination |
|
rescale |
|
SpatRaster
Joseph Lewis
r <- terra::rast(system.file("extdata/SICILY_1000m.tif", package="leastcostpath"))
slope_cs <- create_slope_cs(x = r, cost_function = "tobler", neighbours = 4)
locs <- sf::st_sf(geometry = sf::st_sfc(
sf::st_point(c(839769, 4199443)),
sf::st_point(c(1038608, 4100024)),
crs = terra::crs(r)))
cc <- create_cost_corridor(x = slope_cs, origin = locs[1,], destination = locs[2,], rescale = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.