mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
Fix WKO+ file reader GPS 'drops'
The WKO+ file format appears to record drops in recording of GPS data with a latlon of 180,180. We expect this to be 0,0. This makes the WKO+ file reader consistent with the GoogleMapControl and removes the need to clean data there. If it is found that 180,180 is the standard way of recording drops in GPS signal then we can change the code. We use 0,0 since it is conveniently at sea off the west coast of Africa.
This commit is contained in:
@@ -383,13 +383,19 @@ WKO_UCHAR *WkoParseRawData(WKO_UCHAR *fb, WKO_ULONG version, RideFile *rideFile,
|
||||
memcpy(&llat, &val, 4);
|
||||
lat = (double)llat;
|
||||
lat *= 0.00000008381903171539306640625;
|
||||
sprintf(slat, "%-3.9g", lat);
|
||||
|
||||
val = get_bits(thelot, bit-32,32);
|
||||
memcpy(&llon, &val, 4);
|
||||
lon = (double)llon;
|
||||
lon *= 0.00000008381903171539306640625;
|
||||
|
||||
// WKO handles drops in recording of GPS data
|
||||
// as 180,180 -- we expect 0,0
|
||||
llat=round(lat); llon=round(lon);
|
||||
if (llat == 180 && llon == 180) lat=lon=0;
|
||||
|
||||
sprintf(slon, "%-3.9g", lon);
|
||||
sprintf(slat, "%-3.9g", lat);
|
||||
|
||||
sprintf(GRAPHDATA[i], "%13s %13s", slat,slon);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user