create_FETE_lcps {leastcostpath} | R Documentation |
Calculate Least-cost Paths from each location to all other locations
Description
Calculates Least-cost paths from-everywhere-to-everywhere. This is based on the approach proposed by White and Barber (2012).
Usage
create_FETE_lcps(x, locations, cost_distance = FALSE, ncores = 1)
Arguments
x |
|
locations |
|
cost_distance |
|
ncores |
|
Value
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
Author(s)
Joseph Lewis
Examples
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)
[Package leastcostpath version 2.0.12 Index]