route_split_id {stplanr} | R Documentation |
Split route based on the id or coordinates of one of its vertices
Description
Split route based on the id or coordinates of one of its vertices
Usage
route_split_id(r, id = NULL, p = NULL)
Arguments
r |
An |
id |
The index of the point on the number to be split |
p |
A point represented by an |
Examples
sample_routes <- routes_fast_sf[2:6, 3]
r <- sample_routes[2, ]
id <- round(n_vertices(r) / 2)
r_split <- route_split_id(r, id = id)
plot(r$geometry, lwd = 9, col = "grey")
plot(r_split, col = c("red", "blue"), add = TRUE)
[Package stplanr version 1.2.1 Index]