% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/distance_time_polygons.R
\name{calculate_lc_path}
\alias{calculate_lc_path}
\title{Calculate a least-cost path between one origin and one destination}
\usage{
calculate_lc_path(cs, origin, destination)
}
\arguments{
\item{cs}{A \code{leastcostpath} conductance surface.}

\item{origin}{Origin point.}

\item{destination}{Destination point.}
}
\value{
A least-cost path object or \code{NULL}.
}
\description{
Compatibility wrapper around \code{\link[leastcostpath:create_lcp]{leastcostpath::create_lcp()}} that returns \code{NULL}
when a path cannot be created.
}
\examples{
dem <- terra::rast(nrows = 5, ncols = 5, xmin = 0, xmax = 5, ymin = 0, ymax = 5,
  vals = 1, crs = "EPSG:3857")
cs <- make_conductance_surface(dem)
origin <- terra::vect(data.frame(x = 0.5, y = 0.5), geom = c("x", "y"), crs = "EPSG:3857")
destination <- terra::vect(data.frame(x = 4.5, y = 4.5), geom = c("x", "y"), crs = "EPSG:3857")
calculate_lc_path(cs, origin, destination)
}
