Skip to contents

Get the shoreline from a bathymetric raster

Usage

get_shoreline(bathy_raster, dTolerance = NULL)

Arguments

bathy_raster

SpatRaster object with the bathymetry data.

dTolerance

numeric. The tolerance for simplifying the shoreline. Default is the maximum resolution of the bathymetric raster. If set to 0, the shoreline will not be simplified.

Value

sf POLYGON of the shoreline.

Examples

shoreline <- readRDS(system.file("extdata/rotoma_shoreline.rds",
package = "bathytools"))
point_data <- readRDS(system.file("extdata/depth_points.rds",
package = "bathytools"))
bathy_raster <- rasterise_bathy(shoreline = shoreline,
point_data = point_data, crs = 2193, res = 8)
#> Generating depth points... [2024-11-13 23:08:45]
#> Finished! [2024-11-13 23:08:45]
#> Interpolating to raster... [2024-11-13 23:08:45]
#> Adjusting depths >= 0 to  -0.82 m
#> Finished! [2024-11-13 23:08:46]

shoreline2 <- get_shoreline(bathy_raster = bathy_raster)