% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/openfoam_docker.R
\name{plot_foam_map}
\alias{plot_foam_map}
\title{Plot an OpenFOAM pedestrian-level map}
\usage{
plot_foam_map(
  r,
  layer = "U_mag",
  title = NULL,
  palette = "YlOrRd",
  reverse = FALSE,
  buildings = NULL,
  canopy = NULL,
  legend_title = layer,
  max_u_ref = NULL,
  na_colour = "black",
  scalebar = TRUE,
  scalebar_unit = c("auto", "km", "m"),
  scalebar_cex = 0.7,
  north_arrow = TRUE
)
}
\arguments{
\item{r}{A \code{SpatRaster} (single layer, or one layer will be selected
via \code{layer}).}

\item{layer}{Character. Layer name to plot.  Default \code{"U_mag"}.}

\item{title}{Character.  Plot title.  Default auto-generated.}

\item{palette}{Character.  \code{hcl.colors} palette name.
Default \code{"YlOrRd"}.}

\item{reverse}{Logical.  Reverse palette direction.  Default FALSE.}

\item{buildings}{Optional \code{sf} object of building footprints to
overlay (in the same local coordinate system as the raster).}

\item{canopy}{Optional data frame of canopy cell centres (\code{x}, \code{y})
with a \code{"res"} attribute giving the cell size.  Taken from the
raster's \code{"canopy"} attribute when not supplied, which
\code{\link{read_foam_pedestrian_slice}} attaches whenever the case has a
canopy height raster.}

\item{legend_title}{Character.  Legend label.  Default \code{layer}.}

\item{max_u_ref}{Numeric.  If plotting \code{U_mag}, annotate the colour
scale as a wind speed ratio by dividing by this reference speed.
Default \code{NULL} (no ratio).}

\item{na_colour}{Colour for cells with no result.  Inside the mapped area a
void is an obstruction the flow never entered, so the default is the same
solid black used for buildings and canopy.}

\item{scalebar}{Logical. Draw a distance scale bar in the lower-left corner.
Defaults to \code{TRUE}. Distances assume projected map units are metres;
for geographic rasters they are approximated at the map's mid-latitude.}

\item{scalebar_unit}{Scale bar unit: \code{"km"}, \code{"m"}, or
\code{"auto"} to pick whichever keeps the label readable. Default
\code{"auto"}.}

\item{scalebar_cex}{Scale bar label size multiplier. Defaults to \code{0.7}.}

\item{north_arrow}{Logical. Draw a north arrow above the scale bar. Defaults
to \code{TRUE}.}
}
\value{
A \code{ggplot} object.
}
\description{
Convenience wrapper around \code{ggplot2} for visualising a single layer
from the raster returned by \code{\link{sample_foam_slice}} or
\code{\link{read_foam_pedestrian_slice}}.
}
