% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/roads_conductance.R
\name{make_road_mask}
\alias{make_road_mask}
\title{Create a road-constrained analysis mask}
\usage{
make_road_mask(
  roads,
  escape_points,
  road_buffer_m = 2,
  escape_buffer_m = 5,
  return_components = FALSE
)
}
\arguments{
\item{roads}{Road/pathway network.}

\item{escape_points}{Candidate escape/safety points.}

\item{road_buffer_m}{Road buffer distance in map units, typically meters.}

\item{escape_buffer_m}{Escape-point buffer distance in map units, typically meters.}

\item{return_components}{Logical. If \code{TRUE}, return a list with the mask and
component buffers.}
}
\value{
A dissolved road mask \code{SpatVector}, or a list when \code{return_components = TRUE}.
}
\description{
Buffers the road network and candidate escape points, combines those buffered
areas, and dissolves the result. The mask is used to constrain least-cost
movement to the road/pathway network while allowing access around escape
locations.
}
\examples{
roads <- terra::vect(matrix(c(0, 1, 4, 1), ncol = 2, byrow = TRUE),
  type = "lines", crs = "EPSG:3857")
escape <- terra::vect(data.frame(x = 4, y = 1), geom = c("x", "y"), crs = "EPSG:3857")
make_road_mask(roads, escape, road_buffer_m = 0.1, escape_buffer_m = 0.2)
}
