Learn R Programming

stplanr (version 0.6.2)

update_line_geometry: Update line geometry

Description

Take two SpatialLines objects and update the geometry of the former with that of the latter, retaining the data of the former.

Usage

update_line_geometry(l, nl)

Arguments

l

A SpatialLines object, whose geometry is to be modified

nl

A SpatialLines object of the same length as l to provide the new geometry

See Also

Other lines: angle_diff(), geo_toptail(), is_linepoint(), line2df(), line2points(), line_bearing(), line_match(), line_midpoint(), line_sample(), line_segment(), line_via(), mats2line(), n_sample_length(), n_vertices(), onewaygeo(), onewayid(), points2line(), toptail_buff(), toptailgs()

Examples

Run this code
# 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