toptail_buff: Clip the beginning and ends of 'sf' LINESTRING objects

View source: R/toptail.R

toptail_buffR Documentation

Clip the beginning and ends of sf LINESTRING objects

Description

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()

See Also

Other lines: angle_diff(), geo_toptail(), is_linepoint(), line2df(), line2points(), line_bearing(), line_breakup(), line_midpoint(), line_segment(), line_via(), mats2line(), n_vertices(), onewaygeo(), points2line()

Examples

l <- routes_fast_sf
buff <- zones_sf
r_toptail <- toptail_buff(l, buff)
nrow(l)
nrow(r_toptail)
plot(zones_sf$geometry)
plot(l$geometry, add = TRUE)
plot(r_toptail$geometry, lwd = 5, add = TRUE)

stplanr documentation built on Sept. 15, 2023, 9:07 a.m.