I'm writing a program that receives data in the form of GPRMC NMEA sentences and outputs it as specified by GTFS-realtime.
GTFS-realtime wants a "bearing" value, and describes it as such:
Bearing, in degrees, clockwise from True North, i.e., 0 is North and 90 is East. This can be the compass bearing, or the direction towards the next stop or intermediate location. This should not be deduced from the sequence of previous positions, which clients can compute from previous data.
GPRMC NMEA sentences contain three fields that I believe are relevant, but my research has turned up a bunch of different ideas on what they are:
Track angle in degrees True
,Course Made Good, True
,Track made good in degrees True
Magnetic Variation
,Variation
,Magnetic variation degrees (Easterly var. subtracts from true course)
Magnetic Variation
,East/West
,E or W
For completeness, here's a complete GPRMC sentence, with the relevant fields bolded:
$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,
084.4,230394,
003.1,
W*6A
How would I go about deriving a bearing in GTFS-realtime's format from a GPRMC NMEA sentence?