% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/roads_conductance.R
\name{make_road_origins}
\alias{make_road_origins}
\title{Create road-based origin points inside the evacuation zone}
\usage{
make_road_origins(
  evac_grid,
  roads_buffer,
  hazard_zone = NULL,
  max_origins = NULL,
  seed = NULL
)
}
\arguments{
\item{evac_grid}{Polygon grid from \code{make_evac_grid()}.}

\item{roads_buffer}{Buffered road/pathway network.}

\item{hazard_zone}{Optional hazard-zone polygon used to crop candidate
origins after intersecting the grid with the road buffer.}

\item{max_origins}{Optional maximum number of origin points to retain. Useful
for large regions or exploratory runs.}

\item{seed}{Random seed used when \code{max_origins} is supplied.}
}
\value{
A point \code{SpatVector} of road-based evacuation origins.
}
\description{
Intersects an evacuation grid with a buffered road network and converts the
resulting road-crossing cell geometry to points.
}
\examples{
r <- terra::rast(nrows = 4, ncols = 4, xmin = 0, xmax = 4, ymin = 0, ymax = 4,
  vals = 1, crs = "EPSG:3857")
grid <- make_evac_grid(terra::as.polygons(r, dissolve = TRUE), resolution = 1)
roads <- terra::vect(matrix(c(0, 2, 4, 2), ncol = 2, byrow = TRUE),
  type = "lines", crs = "EPSG:3857")
roads_buffer <- terra::buffer(roads, 0.2)
make_road_origins(grid, roads_buffer, hazard_zone = terra::as.polygons(r, dissolve = TRUE),
  max_origins = 3, seed = 1)
}
