CleanTransect: Clean Transects

View source: R/CleanTransect.R

CleanTransectR Documentation

Clean Transects

Description

Utility function to clean transects and remove anomalies that may break the wave evolution model. This function also ensures that transects are pointing in the correction direction and fixes them if they are not.

Usage

CleanTransect(
  point_elev = NA,
  RadLineDist = 3,
  MaxOnshoreDist = 3,
  trimline = NA
)

Arguments

point_elev

Cross-shore point elevations spatial points object returned from ExtractElev.

RadLineDist

Maximum radial line distance (onshore and offshore) in kilometers of the cross-shore profiles. Note that this value must be the same value used in samplePoints().

MaxOnshoreDist

Numeric. Maximum radial line distance onshore in kilometers. Note that in some instances the onshore extent should be truncated significantly for the wave evolution model. It is recommended to keep this value below 1km.

trimline

Optional back shore trim line used to restrict the on-shore extent of the cross-shore profiles. The default value is NA (not used). If used, the back shore trim line should run parallel to the coastline but be set back onto land. A back shore trim line may be required in cases where cross-shore profiles are generated along the coastline of a narrow peninsula or in instances where there is a back shore lagoon. A back shore trimline should be provided as a simple features line object.

Details

Running this function is required to ensure that there are no artifacts along the cross-shore profile that may cause the subsequent wave and erosion models to fail. This function also adds a cross-shore distance column Xpos to each profile.

Value

An object of class sf and data.frame cleaned and orientated in the proper direction with a cross-shore distance column Xpos added to the data.

Examples

## Not run: 
library(MNAI.CPBT)
data(Coastline)
# Generate cross-shore profile lines along the coastline.
shoreline_points <- samplePoints(
  Coastline = Coastline,
  ShorelinePointDist = 100,
  BufferDist = 50,
  RadLineDist = 1.5
)

# Extract elevation values along each profile
rpath <-  system.file("extdata", "TopoBathy.tif", package = "MNAI.CPBT")
TopoBathy <- raster::raster(rpath)
pt_elevs <- ExtractElev(shoreline_points[[2]], 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 = 1,
  trimline = NA
)


## End(Not run)

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