% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tsunami_zones.R
\name{prepare_tsunami_zones}
\alias{prepare_tsunami_zones}
\title{Prepare separate tsunami zones for escape analysis and visualization}
\usage{
prepare_tsunami_zones(
  inundation,
  dem,
  target_crs = NULL,
  inundation_threshold = 0,
  land_threshold = 0,
  water_threshold = 0,
  dem_sign_multiplier = 1,
  resample_method = "bilinear",
  as_polygon = TRUE,
  dissolve = TRUE
)
}
\arguments{
\item{inundation}{Inundation-depth raster or path to a raster. Cells greater
than \code{inundation_threshold} are treated as inundated.}

\item{dem}{Elevation/topobathymetry raster or path to a raster.}

\item{target_crs}{Optional projected CRS in meters for returned objects.}

\item{inundation_threshold}{Numeric threshold used to define inundated cells.}

\item{land_threshold}{Numeric DEM threshold used to define land. Default is
\code{0}, so land is \code{dem > 0} after applying \code{dem_sign_multiplier}.}

\item{water_threshold}{Numeric DEM threshold used to define water. Default is
\code{0}, so water is \code{dem < 0} after applying \code{dem_sign_multiplier}.}

\item{dem_sign_multiplier}{Multiplier applied to the DEM before land/water
classification. Use \code{-1} when the DEM sign convention is reversed.}

\item{resample_method}{Method passed to \code{terra::resample()} when aligning the
inundation raster to the DEM. Use \code{"bilinear"} for depth rasters and
\code{"near"} for categorical rasters.}

\item{as_polygon}{Logical. If \code{TRUE}, return polygon zones in addition to
rasters.}

\item{dissolve}{Logical. Dissolve polygon pieces.}
}
\value{
A named list with land-only \code{hazard_zone}, water-combined
\code{escape_zone}, and supporting rasters. \code{hazard_zone} should usually be used
for origin generation, mapping, and output clipping. \code{escape_zone} should
usually be passed to \code{run_evacpath(escape_zone = ...)} or
\code{find_escape_points()}.
}
\description{
Tsunami evacuation workflows often need two different zone objects. The
land-only inundation zone is the area where road origins and output time
surfaces should be mapped. The escape-boundary zone should combine the
land-only inundation zone with water so that the coastline is not treated as
an artificial escape boundary. This prevents false escape/safety points along
the water-land edge when roads touch or approach the shoreline.
}
\examples{
dem <- terra::rast(nrows = 6, ncols = 6, xmin = 0, xmax = 6, ymin = 0, ymax = 6,
  crs = "EPSG:3857")
xy <- terra::crds(dem, df = TRUE)
terra::values(dem) <- -1.5 + 0.7 * xy$x + 0.2 * sin(xy$y)
inundation <- dem
terra::values(inundation) <- ifelse(terra::values(dem) > 0 & terra::values(dem) < 2.5, 1, 0)
zones <- prepare_tsunami_zones(inundation, dem, as_polygon = TRUE)
names(zones)
}
