check_locations {leastcostpath}R Documentation

check supplied locations

Description

checks that locations can be reached when calculating least-cost paths

Usage

check_locations(x, locations)

Arguments

x

conductanceMatrix

locations

sf 'POINT' or 'MULTIPOINT', SpatVector, data.frame or matrix containing the locations coordinates

Details

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

Value

message

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")

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)

[Package leastcostpath version 2.0.12 Index]