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:
Mark Liversedge
2011-07-30 19:24:21 +01:00
parent bca738e92f
commit d06c9e97c9

View File

@@ -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);