You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the plot code at L173 was fine — the real bug was in elevation_add(). It used m[, 3] (positional) to split the coordinate matrix by feature, but sf::st_coordinates() on a cast-segmentised sf returns columns X, Y, L1 — so the positional index 3 isL1, which starts at 1 for every feature. All segments end up merged into one geometry, slope_xyz gets one group → one scalar → identical slope for all rows.
Fix: m[, "L1"] — uses the named column, which correctly holds the feature row index.
Activity
Robinlovelace commentedon Jun 24, 2025
Agreed, all segments the same colour, right? 🧐
temospena commentedon Jun 16, 2026
the plot code at L173 was fine — the real bug was in
elevation_add(). It usedm[, 3](positional) to split the coordinate matrix by feature, butsf::st_coordinates()on a cast-segmentised sf returns columnsX, Y, L1— so the positional index 3 isL1, which starts at 1 for every feature. All segments end up merged into one geometry,slope_xyzgets one group → one scalar → identical slope for all rows.Fix:
m[, "L1"]— uses the named column, which correctly holds the feature row index.#66 update column index reference from numeric to L1 in elevation_add()
fix vignette with linestring break segments and add stplanar example …
#66 add route_to_segments function to split linestrings into vertex-t…