View source: R/check_locations.R
check_locations | R Documentation |
checks that locations can be reached when calculating least-cost paths
check_locations(x, locations)
x |
|
locations |
|
Using the supplied conductanceMatrix and locations, the function checks whether: (1) the supplied locations are traversable from at least one adjacent cell (2) the supplied locations are within the extent of the supplied conductanceMatrix
message
Joseph Lewis
r <- terra::rast(system.file("extdata/SICILY_1000m.tif", package="leastcostpath"))
slope_cs <- create_slope_cs(x = r, cost_function = "tobler")
locs <- sf::st_sf(geometry = sf::st_sfc(
sf::st_point(c(861534, 4173726)),
sf::st_point(c(897360, 4155813)),
sf::st_point(c(928364, 4138588)),
crs = terra::crs(r)))
check_locations(x = slope_cs, locations = locs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.