TCpoints2lines {TCHazaRds} | R Documentation |
This function converts a set of point geometries into line segments. The input vector must be a set of points, and the function will draw line segments between consecutive points. An additional point is extrapolated from the last two points to ensure the final segment is complete.
TCpoints2lines(pts_v)
pts_v |
A 'SpatVector' of points (from the 'terra' package). |
A 'SpatVector' containing line geometries created from the input points.
library(terra)
# Create example points
pts <- vect(matrix(c(1, 1, 2, 2, 3, 3), ncol=2), type="points")
# Convert points to line segments
TClines <- TCpoints2lines(pts)