-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathline_breakup.Rd
54 lines (53 loc) · 1.33 KB
/
line_breakup.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/line_breakup.R
\name{line_breakup}
\alias{line_breakup}
\title{Break up line objects into shorter segments}
\usage{
line_breakup(l, z)
}
\arguments{
\item{l}{An sf object with LINESTRING geometry}
\item{z}{An sf object with \code{POLYGON} geometry or a number representing the
resolution of grid cells used to break up the linestring objects}
}
\value{
An sf object with LINESTRING geometry created after breaking up the
input object.
}
\description{
This function breaks up a LINESTRING geometries into smaller pieces.
}
\examples{
library(sf)
z <- zones_sf$geometry
l <- routes_fast_sf$geometry[2]
l_split <- line_breakup(l, z)
l
l_split
sf::st_length(l)
sum(sf::st_length(l_split))
plot(z)
plot(l, add = TRUE, lwd = 9, col = "grey")
plot(l_split, add = TRUE, col = 1:length(l_split))
}
\seealso{
Other lines:
\code{\link{angle_diff}()},
\code{\link{geo_toptail}()},
\code{\link{is_linepoint}()},
\code{\link{line2df}()},
\code{\link{line2points}()},
\code{\link{line_bearing}()},
\code{\link{line_midpoint}()},
\code{\link{line_segment}()},
\code{\link{line_segment1}()},
\code{\link{line_via}()},
\code{\link{mats2line}()},
\code{\link{n_segments}()},
\code{\link{n_vertices}()},
\code{\link{onewaygeo}()},
\code{\link{points2line}()},
\code{\link{toptail_buff}()}
}
\concept{lines}