ExtractElev: Extract Elevation

View source: R/ExtractElev.R

ExtractElevR Documentation

Extract Elevation

Description

Extract elevation values along cross-shore profiles lines.

Usage

ExtractElev(cross_shore_profiles = NA, TopoBathy = NA)

Arguments

cross_shore_profiles

Cross-shore profile lines from samplePoints.

TopoBathy

TopoBathy digital elevation model of class RasterLayer.

Value

Spatial points of class sf with extracted elevation values along each cross-shore profile.

Examples

## Not run: 
library(MNAI.CPBT)
data(Coastline)
shoreline_points <- samplePoints(
  Coastline = Coastline,
  ShorelinePointDist = 150, # where to sample points on shoreline
  BufferDist = 300.0, # Buffer distance in meters for vertical line
  RadLineDist = 3.0 # Line dist in km
)

# Cross-shore profile lines
plot(sf::st_geometry(Coastline))
cross_shore_profiles <- shoreline_points[[2]]
plot(sf::st_geometry(cross_shore_profiles), add=TRUE)

# Extract elevation along each profile
rpath <-  system.file("extdata", "TopoBathy.tif", package = "MNAI.CPBT")
TopoBathy <- raster::raster(rpath)
pt_elevs <- ExtractElev(cross_shore_profiles, TopoBathy)
plot(pt_elevs['elev'])
# plot(TopoBathy)

## End(Not run)

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