-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathangle_diff.Rd
61 lines (58 loc) · 2.01 KB
/
angle_diff.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
61
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/linefuns.R
\name{angle_diff}
\alias{angle_diff}
\title{Calculate the angular difference between lines and a predefined bearing}
\usage{
angle_diff(l, angle, bidirectional = FALSE, absolute = TRUE)
}
\arguments{
\item{l}{A spatial lines object}
\item{angle}{an angle in degrees relative to North, with 90 being East and -90 being West.
(direction of rotation is ignored).}
\item{bidirectional}{Should the result be returned in a bidirectional format?
Default is FALSE. If TRUE, the same line in the oposite direction would have the same bearing}
\item{absolute}{If TRUE (the default) only positive values can be returned}
}
\description{
This function was designed to find lines that are close to parallel and perpendicular
to some pre-defined route. It can return results that are absolute (contain information
on the direction of turn, i.e. + or - values for clockwise/anticlockwise),
bidirectional (which mean values greater than +/- 90 are impossible).
}
\details{
Building on the convention used in in the \code{bearing()} function from the
\code{geosphere} package and in many applications,
North is definied as 0, East as 90 and West as -90.
}
\examples{
lib_versions <- sf::sf_extSoftVersion()
lib_versions
# fails on some systems (with early versions of PROJ)
if (lib_versions[3] >= "6.3.1") {
# Find all routes going North-South
lines_sf <- od2line(od_data_sample, zones = zones_sf)
angle_diff(lines_sf[2, ], angle = 0)
angle_diff(lines_sf[2:3, ], angle = 0)
}
}
\seealso{
Other lines:
\code{\link{geo_toptail}()},
\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}