Skip to contents

baseline_filter allows to filter the original intersections and select only the closest intersection between each transect and coastline.

Usage

baseline_filter(shp, position = "MIX", out_points)

Arguments

shp

Shapefile. A point format shapefile with the intersections between each transect and each shoreline.

position

character. Default "MIX". position = "MIX" is recommended for use a coastline as baseline. The baseline position in relation to the coastlines. There are three options: "MIX" for intermediate baselines, "OFF" for offshore baselines, and "ON" for onshore baselines.

out_points

Integer. Output name for the filter intersection points shapefile.

Value

  • A shapefile with the filtered intersection points, only one point for each transect/shoreline pair.

Details

This function is part of the pre-processing stages and is used to ensure that for each baseline-transect, only one crossing with each date-stamped coastline is used. The filter selects the crossing that is closest to the baseline and neglects the others (Gomez-Pazo et al., 2022).

References

Gomez-Pazo, A., Payo, A., Paz-Delgado, M.V., Delgadillo-Calzadilla, M.A. (2022) Open Digital Shoreline Analysis System: ODSAS v1.0 Journal of Marine Science and Engineering, 10, 26.

Examples


#Load libraries
library(sf)
#> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
library(CoastCR)

#Intersections shapefile
shp <- st_read(system.file("extdata/intersect.shp", package = "CoastCR"))
#> Reading layer `intersect' from data source 
#>   `/home/runner/work/_temp/Library/CoastCR/extdata/intersect.shp' 
#>   using driver `ESRI Shapefile'
#> Simple feature collection with 264 features and 3 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 508058.2 ymin: 4674243 xmax: 508101 ymax: 4674329
#> Projected CRS: ETRS89 / UTM zone 29N

#Define baseline position. Offshore = OFF; Onshore = ON; Mixed = MIX.
position = "OFF"

#Define output name
out_points <- tempfile("inters_filter", fileext = ".shp")

baseline_filter(shp, position, out_points)
#> Writing layer `inters_filter1991370a1514' to data source 
#>   `/tmp/RtmpwOQn8r/inters_filter1991370a1514.shp' using driver `ESRI Shapefile'
#> Writing 128 features with 4 fields and geometry type Point.