data(routes_fast)
lpoints <- line2pointsn(routes_fast[2,]) # for a single line
lpoints2 = line2points(routes_fast[2,])
plot(lpoints)
plot(lpoints2)
lpoints = line2pointsn(routes_fast) # for many lines
plot(lpoints)
data(flowlines) # load demo flowlines dataset
lpoints <- line2points(flowlines) # for many lines
sp::proj4string(lpoints) # maintains CRS info
plot(lpoints) # note overlapping points
i = 3
j = (2*i):((2*i)+1)
plot(flowlines[i,])
plot(lpoints[j,], add = TRUE)
Run the code above in your browser using DataLab