Breaking long line segments into shorter ones in R using sf
I was looking for exactly this function to use with NHDPlus data. I spent some time with JMT2080AD's functions but needed a bit more scalable solution.
The function in this gist does the trick pretty nicely. There is a reproducible example at the bottom of the gist too.
--- Edit:
There is also now a function to do this in the lwgeom package. https://github.com/r-spatial/lwgeom/issues/16