We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
line_segment
segment_length
Hi,
Thanks for a very cool package!
I think there might be a bug in your line_segment() function when using the segment_length argument.
line_segment()
E.g.
> l <- routes_fast_sf[2, ] > l_split <- line_segment(l = l, segment_length = 500) Error in Ops.units(n_segments, 1) : both operands of the expression should be "units" objects
The cause appears to be that round(l_length/segment_length) returns an object in units , which causes n_segments + 1 to fail.
round(l_length/segment_length)
n_segments + 1
stplanr/R/linefuns.R
Lines 157 to 164 in 8a9c7b5
Coercing n_segments to a numeric should fix this.
n_segments
if (!is.na(segment_length)) { l_length <- sf::st_length(l) n_segments <- as.numeric(round(l_length / segment_length)) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
Thanks for a very cool package!
I think there might be a bug in your
line_segment()
function when using thesegment_length
argument.E.g.
The cause appears to be that
round(l_length/segment_length)
returns an object in units , which causesn_segments + 1
to fail.stplanr/R/linefuns.R
Lines 157 to 164 in 8a9c7b5
Coercing
n_segments
to a numeric should fix this.The text was updated successfully, but these errors were encountered: