From: robertl Date: Thu, 2 Jun 2011 00:04:58 +0000 (+0000) Subject: Actually use lat AND lon (blush) when computingn distance in track filter. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~886 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b2a5b8d11c3d37f6fb85c49edd6b9a38ee9204c3;p=gpsbabel.git Actually use lat AND lon (blush) when computingn distance in track filter. Use sensible thresholds. --- diff --git a/gpsbabel/trackfilter.c b/gpsbabel/trackfilter.c index 1e47ec3bf..4344b83fd 100644 --- a/gpsbabel/trackfilter.c +++ b/gpsbabel/trackfilter.c @@ -1087,9 +1087,16 @@ trackfilter_points_are_same(const waypoint *wpta, const waypoint *wptb) { // We use a simpler (non great circle) test for lat/lon here as this // is used for keeping the 'bookends' of non-moving points. + // + // Latitude spacing is about 27 feet per .00001 degree. + // Longitude spacing varies, but the reality is that anything closer + // than 27 feet does little but clutter the output. + // As this is about the limit of consumer grade GPS, it seems a + // reasonable tradeoff. + return - abs(wpta->latitude - wptb->latitude) < .0000001 && - abs(wpta->latitude - wptb->latitude) < .0000001 && + fabs(wpta->latitude - wptb->latitude) < .00001 && + fabs(wpta->longitude - wptb->longitude) < .00001 && abs(wpta->altitude - wptb->altitude) < 20 && (WAYPT_HAS(wpta,course) == WAYPT_HAS(wptb,course)) && (wpta->course == wptb->course) &&