Closed scoddou closed 2 years ago
Closing here.
Ended up using a complete sf
implementation that is good enough for me to proceed. In case anyone stumbles upon this thread in the future:
library(sf)
line = st_sfc(st_linestring(matrix(c(0,0,0,10,0,20,0,30,0,40),ncol=2, byrow=TRUE)))
points = st_cast(line,"POINT")
st_cast(st_difference(line,st_union(st_buffer(points,dist=0.00001))),"LINESTRING")
Geometry set for 4 features
Geometry type: LINESTRING
Dimension: XY
Bounding box: xmin: 0 ymin: 1e-05 xmax: 0 ymax: 39.99999
CRS: NA
LINESTRING (0 1e-05, 0 9.99999)
LINESTRING (0 10.00001, 0 19.99999)
LINESTRING (0 20.00001, 0 29.99999)
LINESTRING (0 30.00001, 0 39.99999)
Describe the bug I noticed while using lwgeom::st_split to split a LINESTRING on its own POINT's that the resulting sfc is reordered. Is this repeatable on your end (realizing lwgeom is just a binding to liblwgeom), and if so, is there a better way for me to "segment" linestrings by their vertices while retaining order?
To Reproduce
giving