buffer_validation: Calculate the similarity of a least-cost path to a known...

View source: R/buffer_validation.R

buffer_validationR Documentation

Calculate the similarity of a least-cost path to a known route

Description

Calculates the similarity of a least-cost path to a known route using the buffer method proposed by Goodchild and Hunter (1997)

Usage

buffer_validation(lcp, comparison, dist)

Arguments

lcp

sf or spatVector

comparison

sf or spatVector

dist

numeric buffer distances to assess similarity

Value

data.frame

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

josephlewis/leastcostpath documentation built on Oct. 18, 2023, 2:03 p.m.