Learn R Programming

stplanr (version 0.1.4)

line_bearing: Find the bearing of straight lines

Description

This is a simple wrapper around the geosphere function bearing to return the bearing (in degrees relative to north) of lines.

Usage

line_bearing(l, bidirectional = FALSE)

Arguments

l
A SpatialLinesDataFrame
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

Details

Returns a boolean vector. TRUE means that the associated line is in fact a point (has no distance). This can be useful for removing data that will not be plotted.

Examples

Run this code
line_bearing(flowlines)
line_bearing(flowlines, bidirectional = TRUE)

Run the code above in your browser using DataLab