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

toptail_buff(l, buff, ...)

Arguments

l

An sf LINESTRING object

buff

An sf POLYGON object to act as the buffer

...

Arguments passed to rgeos::gBuffer()

See also

Examples

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