% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/write_outputs.R
\name{write_evac_outputs}
\alias{write_evac_outputs}
\title{Write evacpath outputs to disk}
\usage{
write_evac_outputs(
  result,
  output_dir,
  prefix = "evacpath",
  overwrite = TRUE,
  include_inputs = FALSE
)
}
\arguments{
\item{result}{An object returned by \code{run_evacpath()}.}

\item{output_dir}{Output directory.}

\item{prefix}{Filename prefix.}

\item{overwrite}{Logical. Overwrite existing files.}

\item{include_inputs}{Logical. Also write projected input layers.}
}
\value{
A named character vector of written file paths.
}
\description{
Writes the main spatial outputs in an \code{evacpath_result} list to GeoPackage and
GeoTIFF files. Non-spatial objects, including the conductance surface, are not
written.
}
\examples{
dem <- terra::rast(nrows = 7, ncols = 7, xmin = 0, xmax = 7, ymin = 0, ymax = 7,
  vals = 1, crs = "EPSG:3857")
hazard_raster <- terra::crop(dem, terra::ext(1, 6, 1, 6))
hazard <- terra::as.polygons(hazard_raster, dissolve = TRUE)
roads <- terra::vect(matrix(c(0, 3.5, 7, 3.5), ncol = 2, byrow = TRUE),
  type = "lines", crs = "EPSG:3857")
result <- run_evacpath(
  hazard_zone = hazard,
  roads = roads,
  dem = dem,
  grid_resolution = 1,
  road_buffer_m = 0.2,
  escape_buffer_m = 0.3,
  final_road_buffer_m = 0.2,
  max_origins = 2,
  max_destinations = 2,
  seed = 1
)
out_dir <- file.path(tempdir(), "evacpath-example")
paths <- write_evac_outputs(result, output_dir = out_dir, prefix = "example")
unlink(out_dir, recursive = TRUE)
}
