geo_bearing: Calculate bearing

Description Usage Arguments Value Examples

View source: R/bearing.R

Description

Calculate bearing

Usage

1
geo_bearing(point1, point2)

Arguments

point1

start geojson Feature<Point>

point2

end geojson Feature<Point>

Value

(number) bearing in decimal degrees

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
point1 <- '{
  "type": "Feature",
  "properties": {
    "marker-color": "#f00"
   },
   "geometry": {
      "type": "Point",
      "coordinates": [-75.343, 39.984]
   }
}'

point2 <- '{
  "type": "Feature",
  "properties": {
     "marker-color": "#0f0"
   },
   "geometry": {
      "type": "Point",
      "coordinates": [-75.534, 39.123]
    }
}'

geo_bearing(point1, point2)

Example output

[1] -170.233

geoops documentation built on July 1, 2020, 10:39 p.m.