I have a shapefile of river segments that I've imported into R. The segments range in length from 5-115km. I want to split the segments that are over 10km into 10km chunks. So I use st_segmentize
. But this doesn't actually split a long line into multiple new shorter lines, which is what I want... Is there a way to do this? I think st_segmentize
just adds vertices every 10km. So I just need to split the lines at the vertices.
Code so far:
library("sf")
rivers = st_read("./YukonMain4_copy.shp", layer = 'YukonMain4_copy')
seg = st_segmentize(rivers, units::set_units(10,km))
Thanks for your help!