MobilityDB 1.3
Loading...
Searching...
No Matches

◆ geog_bearing()

static Datum geog_bearing ( Datum  point1,
Datum  point2 
)
static

Return the bearing between two geography points.

The formulae used are the following:

  • lat = sin(Δlong).cos(lat2)
  • long = cos(lat1).sin(lat2) - sin(lat1).cos(lat2).cos(Δlong)
  • θ = atan2(lat, long)
    Note
    Derived from https://gist.github.com/jeromer/2005586
    In PostGIS, for geodetic coordinates, X is longitude and Y is latitude