Skip to contents

Takes lines and removes the start and end point, to a distance determined by the nearest buff polygon border.

Usage

toptail_buff(l, buff, ...)

Arguments

l

An sf object representing lines

buff

An sf object with POLYGON geometry to buffer the linestring.

...

Arguments passed to sf::st_buffer()

Examples

l <- routes_fast_sf
buff <- zones_sf
r_toptail <- toptail_buff(l, buff)
nrow(l)
#> [1] 42
nrow(r_toptail)
#> [1] 11
plot(zones_sf$geometry)
plot(l$geometry, add = TRUE)
plot(r_toptail$geometry, lwd = 5, add = TRUE)