Skip to content

Commit

Permalink
Fix #514
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Aug 15, 2023
1 parent 0c01642 commit 6412bc1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions R/linefuns.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,12 @@ line_midpoint <- function(l, tolerance = NULL) {
#' l_seg_100 <- line_segment(l = l, segment_length = 100)
#' plot(sf::st_geometry(l_seg2), col = 1:2, lwd = 5)
#' plot(sf::st_geometry(l_seg3), col = 1:3, lwd = 5)
#' plot(sf::st_geometry(l_seg3), col = 1:3)
#' plot(sf::st_geometry(l_seg_100), col = seq(nrow(l_seg_100)))
line_segment <- function(l, n_segments, segment_length = NA) {
if (!is.na(segment_length)) {
browser()
l_length <- sf::st_length(l)
l_length <- as.numeric(sf::st_length(l))
n_segments <- round(l_length / segment_length)
}
# browser() # tests
# first_linestring = lwgeom::st_linesubstring(x = l, from = 0, to = 0.2)
from_to_sequence = seq(from = 0, to = 1, length.out = n_segments + 1)
line_segment_list = lapply(seq(n_segments), function(i)
Expand Down

0 comments on commit 6412bc1

Please sign in to comment.