% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/escape_boundary.R
\name{crop_roads_to_inner_extent}
\alias{crop_roads_to_inner_extent}
\title{Crop roads to an inset extent before escape-point detection}
\usage{
crop_roads_to_inner_extent(roads, zone, inset_x_m = 250, inset_y_m = 250)
}
\arguments{
\item{roads}{Road/pathway network as a \code{SpatVector} or file path.}

\item{zone}{Zone used to define the outer extent. Can be a \code{SpatVector},
\code{SpatRaster}, or file path.}

\item{inset_x_m}{Numeric. Distance to inset the minimum and maximum x
boundaries, in map units. Use meters when the data are projected.}

\item{inset_y_m}{Numeric. Distance to inset the minimum and maximum y
boundaries, in map units. Use meters when the data are projected.}
}
\value{
A cropped road/pathway \code{SpatVector}.
}
\description{
Crops a road/pathway layer to a slightly reduced bounding box around a zone.
This is useful before escape-point detection because roads extending beyond the
study-area coverage can intersect artificial raster or polygon extent edges and
create false escape/safety points.
}
\examples{
r <- terra::rast(nrows = 4, ncols = 4, xmin = 0, xmax = 4, ymin = 0, ymax = 4,
  vals = 1, crs = "EPSG:3857")
zone <- terra::as.polygons(r, dissolve = TRUE)
roads <- terra::vect(matrix(c(-1, 2, 5, 2), ncol = 2, byrow = TRUE),
  type = "lines", crs = "EPSG:3857")
crop_roads_to_inner_extent(roads, zone, inset_x_m = 0.5, inset_y_m = 0)
}
