Small function that connects dots and makes them one line which can later be used as a cutoff for the RD.

points2line(borderpoints, crs)

Arguments

borderpoints

a set of points on a boundary

crs

set the coordinate reference system (CRS)

Value

a line as an sf object

Examples

points_samp.sf <- sf::st_sample(polygon_full, 2) # create points
# make it an sf object bc st_sample only created the geometry list-column (sfc):
points_samp.sf <- sf::st_sf(points_samp.sf)
points2line(points_samp.sf, crs = sf::st_crs(points_samp.sf))
#> Geometry set for 1 feature 
#> Geometry type: MULTILINESTRING
#> Dimension:     XYZ
#> Bounding box:  xmin: 410668.6 ymin: 1684989 xmax: 413319.9 ymax: 1713553
#> Projected CRS: WGS 84 / UTM zone 43N
#> MULTILINESTRING Z ((410668.6 1713553 1, 413319....