View source: R/create_FETE_lcps.R
create_FETE_lcps | R Documentation |
Calculates Least-cost paths from-everywhere-to-everywhere. This is based on the approach proposed by White and Barber (2012).
create_FETE_lcps(x, locations, cost_distance = FALSE, ncores = 1)
x |
|
locations |
|
cost_distance |
|
ncores |
|
sf
or spatVector
Least-cost paths from-everywhere-to-everywhere based on the supplied conductanceMatrix
. If supplied locations
is a spatVector
object then spatVector
object returned else sf
object
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)),
sf::st_point(c(907695, 4145478)),
sf::st_point(c(907695, 4145478)),
crs = terra::crs(r)))
lcps <- create_FETE_lcps(x = slope_cs, locations = locs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.