# NOT RUN {
shp <- routes_fast[2, ]
plot(shp)
rfs10 <- mapshape(shp)
rfs5 <- mapshape(shp, percent = 5)
rfs1 <- mapshape(shp, percent = 1)
plot(rfs10, add = TRUE, col = "red")
plot(rfs5, add = TRUE, col = "blue")
plot(rfs1, add = TRUE, col = "grey")
# snap the lines to the nearest interval
rfs_int <- mapshape(shp, ms_options = "snap-interval=0.001")
plot(shp)
plot(rfs_int, add = TRUE)
mapshape(routes_fast_sf[2, ])
# }
Run the code above in your browser using DataLab