Take two SpatialLines objects and update the geometry of the former with that of the latter, retaining the data of the former.
update_line_geometry(l, nl)
A SpatialLines object, whose geometry is to be modified
A SpatialLines object of the same length as l
to provide the new geometry
Other lines:
angle_diff()
,
geo_toptail()
,
is_linepoint()
,
line2df()
,
line2points()
,
line_bearing()
,
line_breakup()
,
line_match()
,
line_midpoint()
,
line_sample()
,
line_segment()
,
line_via()
,
mats2line()
,
n_sample_length()
,
n_vertices()
,
onewaygeo()
,
points2line()
,
toptail_buff()
,
toptailgs()
# NOT RUN {
data(flowlines)
l <- flowlines[2:5, ]
nl <- routes_fast
nrow(l)
nrow(nl)
l <- l[!is_linepoint(l), ]
names(l)
names(routes_fast)
l_newgeom <- update_line_geometry(l, nl)
plot(l, lwd = l$All / mean(l$All))
plot(l_newgeom, lwd = l$All / mean(l$All))
names(l_newgeom)
# }
Run the code above in your browser using DataLab