% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tsunami_zones.R
\name{make_roads_in_zone}
\alias{make_roads_in_zone}
\title{Create a buffered road area inside an inundation or analysis zone}
\usage{
make_roads_in_zone(
  roads,
  zone,
  road_buffer_m = 2,
  crop_buffer_m = 3,
  include_zone = TRUE
)
}
\arguments{
\item{roads}{Road/pathway network.}

\item{zone}{Polygon/raster zone used to crop buffered roads.}

\item{road_buffer_m}{First road buffer distance.}

\item{crop_buffer_m}{Optional second buffer applied before cropping.}

\item{include_zone}{Logical. If \code{TRUE}, combine the cropped road buffer with
\code{zone} and dissolve the result.}
}
\value{
A \code{SpatVector}.
}
\description{
Mirrors the original script logic where roads were buffered, optionally
buffered again for tolerance, cropped to the inundation zone, and then
combined with the zone. This is useful for quality assurance and quality
control and for reproducing the earlier road-plus-inundation analysis area.
}
\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(0, 2, 4, 2), ncol = 2, byrow = TRUE),
  type = "lines", crs = "EPSG:3857")
make_roads_in_zone(roads, zone, road_buffer_m = 0.1)
}
