-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathgeo_toptail.Rd
60 lines (58 loc) · 1.63 KB
/
geo_toptail.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
55
56
57
58
59
60
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/toptail.R
\name{geo_toptail}
\alias{geo_toptail}
\alias{toptail}
\title{Clip the first and last n metres of SpatialLines}
\usage{
geo_toptail(l, toptail_dist, ...)
}
\arguments{
\item{l}{An \code{sf} object representing lines}
\item{toptail_dist}{The distance (in metres) to top and tail the line by.
Can either be a single value or a vector of the same length as the
SpatialLines object.}
\item{...}{Arguments passed to \code{sf::st_buffer()}}
}
\description{
Takes lines and removes the start and end point, to a distance determined
by the user.
}
\details{
Note: see the function
\href{https://github.com/ropensci/stplanr/blob/v1.0.0/R/toptail.R}{\code{toptailgs()}}
in stplanr v0.8.5 for an implementation that uses the geosphere
package.
}
\examples{
lib_versions <- sf::sf_extSoftVersion()
lib_versions
# dont test due to issues with sp classes on some set-ups
if (lib_versions[3] >= "6.3.1") {
l <- routes_fast_sf[2:4, ]
l_top_tail <- geo_toptail(l, 300)
l_top_tail
plot(sf::st_geometry(l_top_tail))
plot(sf::st_geometry(geo_toptail(l, 600)), lwd = 9, add = TRUE)
}
}
\seealso{
Other lines:
\code{\link{angle_diff}()},
\code{\link{is_linepoint}()},
\code{\link{line2df}()},
\code{\link{line2points}()},
\code{\link{line_bearing}()},
\code{\link{line_breakup}()},
\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}