---
title: "Overview of ExposR"
date: "12 June 2023"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Overview of ExposR}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
## EXPOS Model
The EXPOS model uses a digital elevation model (DEM) to estimate exposed and
protected areas for a given hurricane wind direction and inflection angle.
The resulting topograhic exposure maps can be combined with output from the
HURRECON model to estimate hurricane wind damage across a region.
EXPOS contains two main functions:
1. The expos_model function estmates topopgrahic exposure for a specified
wind direction and inflection angle. The input file is assumed to be a raster of
elevation values in GeoTiff format with missing values represented by zero. Cells
may be rectangular. The user can specify if coordinates are latitude/longitude;
otherwise latitude/longitude is assumed if X values are between -180 and 180 and
Y values are between -90 and 90. If coordinates are latitude/longitude, horizontal
and vertical units are assumed to be degrees and meters, respectively; otherwise
horizontal and vertical units must be the same. Columns are assumed to be closely
aligned with true North (0 degrees); if not, the map orientation (azimuth) must be
specified in degrees. The name of the input file is assumed to be "dem.tif".
The output file is a raster file in GeoTiff format with the following values:
0 = missing data, 1 = protected, 2 = exposed. Output files are named
"expos-xxx-yy.tif" where xxx is the wind direction and yy is the inflection angle.
In previous studies, spatial resolutions of 30 or 60 meters and an inflection angle of
6 degrees were found to work well (see below). Note that increasing the inflection
angle tends to decrease the size and number of protected areas while increasing
the odds that these sites are protected.
2. The expos_damage function estimates regional hurricane damage where
topographic exposure at each location is determined by peak wind direction. If
a location is protected, the enhanced Fujita scale (EF) rating from HURRECON
is reduced by a specified number of EF ratings. This function requires a hurricane
GeoTiff file created by HURRECON, exposure files created by EXPOS for the eight
cardinal wind directions (N, NE, E, etc), and a reprojection file in CSV format
(reproject.csv) that contains latitude/longitude coordinates for the lower
left and upper right corners of the digital elevation model (variables: name,
lat_0, lon_0, lat_1, lon_1).
The output file is a raster file in GeoTiff format with the following values:
0 = missing, 1 = no damage, 2 = EF0 damage, 3 = EF1 damage, 4 = EF2 damage,
5 = EF3 damage, 6 = EF4 damage, 7 = EF5 damage. Output files are named
"hhhh-damage-yy-z.tif" where hhhh is the hurricane ID, yy is the inflection
angle, and z is the reduction in EF rating for protected areas.
Note: for large areas, best results will be obtained by converting the DEM to
latitude/longitude coordinates (if necessary) before running expos_model
and expos_damage and then converting the resulting damage maps to the
desired map projection.
## Getting Started
Here are the basic steps for using the model. Please see below for more details.
1. Install and load the R package for the model (ExposR).
2. Create a directory for a particular study area with subdirectories as described
below.
3. Copy the digital elevation file to the dem subdirectory and rename it
"dem.tif".
4. Download or create geographic and political boundary shapefiles for the desired
study area. Copy these files to the vector subdirectory and rename so the
first name of each file is "boundaries".
5. Use the expos_model function to create exposure maps for different wind
directions and inflection angles.
6. Use the expos_damage function to create maps of enhanced Fujita scale
wind damage for particular hurricanes.
## Details
All user functions begin with "expos". The wind direction and inflection angle must
be specified in degrees.
The user specifies a directory (exp_path) for a given study area. Input and
output files are stored on the following subdirectories of this directory:
```
exp_path/dem
exp_path/exposure
exp_path/damage
exp_path/vector
```
The dem subdirectory contains the input elevation file. The exposure
subdirectory contains output files from the expos_model function. The
damage subdirectory contains input files from the HURRECON model, the
reprojection file, and output files from the expos_damage function.
Shapefiles that contain geographic and political boundaries for viewing results
are stored on the vector subdirectory.
To run the model, create the above directories, copy the input files to their
respective subdirectories, and use the library function to load ExposR.
## Model Functions
```
expos_set_path
expos_get_path
expos_model
expos_damage
expos_summarize
expos_plot
```
The expos_set_path function sets the path for the current set of model runs.
The expos_get_path function returns the current path. Use expos_set_path
before using other functions.
The expos_model function creates a raster file of topographic wind exposure
as a function of wind direction and inflection angle.
The expos_damage function uses output from EXPOS and HURRECON to create a
raster file of wind damage where topograhic exposure at each location is determined
by peak wind direction. If a location is protected, the enhanced Fujita scale
rating is reduced by a specfied amount.
The expos_summarize function displays summary information for a specified
raster file, including the number of rows and columns, spatial extent, cell height
and width, and minimum and maximum value.
The expos_plot function creates a plot of a specified raster file.
## Examples
```
expos_set_path("c:/expos/wach_30m")
expos_get_path()
expos_model(wind_direction=90, inflection_angle=6)
expos_damage(hurricane="AL1938-06", inflection_angle=6, protect=2)
expos_summarize("dem")
expos_summarize("expos-090-06")
expos_summarize("AL1938-06-damage-06-2")
expos_plot("dem")
expos_plot("expos-090-06")
expos_plot("AL1938-06-damage-06-2")
```
## History
The original EXPOS model was written in Borland Pascal and depended on Idrisi
for spatial visualization. The model was used in published studies of the ecological
impacts of historical hurricanes in New England and Puerto Rico:
* Boose, E. R., Foster, D. R., Fluet, M. 1994. Hurricane impacts to tropical and
temperate forest landscapes. Ecological Monographs 64: 369-400. doi.org/10.2307/2937142.
* Boose, E. R., Chamberlin, K. E., Foster, D. R. 2001. Landscape and regional impacts
of hurricanes in New England. Ecological Monographs 71: 27-48.
doi.org/10.1890/0012-9615(2001)071[0027:LARIOH]2.0.CO;2.
* Boose, E. R., Serrano, M. I., Foster, D. R. 2004. Landscape and regional impacts of
hurricanes in Puerto Rico. Ecological Monographs 74: 335-352. doi.org/10.1890/02-4057.