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)))
lcp1 <- create_lcp(x = slope_cs, origin = locs[1,], destination = locs[2,])
lcp2 <- create_lcp(x = slope_cs, origin = locs[2,], destination = locs[1,])
buffer_validation(lcp = lcp1, comparison = lcp2, dist = c(1000, 2500, 5000, 10000))
Run the code above in your browser using DataLab