ExtractElev | R Documentation |
Extract elevation values along cross-shore profiles lines.
ExtractElev(cross_shore_profiles = NA, TopoBathy = NA)
cross_shore_profiles |
Cross-shore profile lines from samplePoints. |
TopoBathy |
TopoBathy digital elevation model of class RasterLayer. |
Spatial points of class sf with extracted elevation values along each cross-shore profile.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.