FloodContours: Flood Contour Generation

View source: R/FloodContours.R

FloodContoursR Documentation

Flood Contour Generation

Description

Generates flood contours of the storm event.

Usage

FloodContours(
  TopoBathy = NA,
  mean_high_water = NA,
  total_wsl_adj = NA,
  erosion_totals = NA
)

Arguments

TopoBathy

TopoBathy digital elevation model of class RasterLayer.

mean_high_water

Mean high water tidal level above the chart datum.

total_wsl_adj

Total water surface level above the chart datum. Recall that the chart datum and TopoBathy DEM are referenced to have 0 at low water. It is therefore suggested to set this value at the mean sea level above chart datum or a specific tidal elevation of interest.

erosion_totals

Erosion summaries across the area of interest.

Value

A list object of flood contours and water surface elevation rasters.

Examples

## Not run: 
library(MNAI.CPBT)
data(Coastline)
# Generate cross-shore profile lines along the coastline.
ShorelinePointDist = 150
crossshore_profiles <- samplePoints(
  Coastline = Coastline,
  ShorelinePointDist = ShorelinePointDist,
  BufferDist = 50, RadLineDist = 1.5)
crossshore_lines <- crossshore_profiles[[2]]


# Extract elevation values along each profile
rpath <-  system.file("extdata", "TopoBathy.tif", package = "MNAI.CPBT")
TopoBathy <- raster::raster(rpath)
pt_elevs <- ExtractElev(crossshore_lines, TopoBathy)


# Run SignalSmooth function to smooth elevation profiles
pt_elevs <- SignalSmooth(point_elev = pt_elevs,
SmoothParameter = 5)


# Clean the cross-shore profiles with CleanTransect
cleantransect <- CleanTransect(
  point_elev = pt_elevs,
  RadLineDist = 1.5, MaxOnshoreDist = 0.01, trimline = NA
)

# Merge vegetation onto lines
data(Vegetation)
dat_veg <- ExtractVeg(pt_exp = cleantransect, Vegetation = Vegetation)

# Run the wave evolution model
wave_data <- WaveModel(dat = dat_veg,
  total_wsl_adj = 1.2,
  Ho = 1.5, To = 5)

# Link data to foreshore beach attributes
linkbeach <- LinkProfilesToBeaches(BeachAttributes = BeachAttributes,
dat = wave_data)

# Run the erosion model
erosion <- ErosionTransectsUtil(
    Ho = 2, To = 8, total_wsl_adj = 1.2,
    linkbeach = linkbeach, wave_data = wave_data,
    storm_duration = 3, Tr = 10,
    Longshore = ShorelinePointDist, PropValue = 200,
    disc = 0.05, TimeHoriz = 50)

# Get the erosion damage totals across the study area
erosion_totals <- ErosionTotals(wave_data = wave_data,
  erosion = erosion, Longshore = ShorelinePointDist)

# Build flood contours (and rasters of water surface elevation)
# over the study area.
 flood_contours <- FloodContours(TopoBathy = TopoBathy, mean_high_water = 1,
  total_wsl_adj = 1.2, erosion_totals = erosion_totals)

 # Inspect object
 names(flood_contours)
 fc <- flood_contours$contours
 head(fc)

 # View the flood contours - use mapview if installed
 # library(mapview)
 # mapview(fc)
 plot(sf::st_geometry(fc))
 plot(fc['name'])



## End(Not run)

essatech/MNAI.CPBT documentation built on July 1, 2023, 12:34 p.m.