library(quadtree)
habitat <- terra::rast(system.file("extdata", "habitat.tif", package="quadtree"))
qt <- quadtree(habitat, split_threshold = .1, adj_type = "expand")
start_pt <- c(19000, 25000)
end_pt <- c(33015, 38162)
# find LCP from 'start_pt' to 'end_pt'
lcpf <- lcp_finder(qt, start_pt)
lcp <- find_lcp(lcpf, end_pt)
# retrieve ALL the paths that have been calculated
paths <- summarize_lcps(lcpf)
head(paths)
Run the code above in your browser using DataLab