From 00c2b2b64195b306b7712eae61bf05f149b612e7 Mon Sep 17 00:00:00 2001 From: sonora Date: Tue, 18 Jun 2013 18:17:23 +0200 Subject: [PATCH] fix 1946 (5) --- OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java b/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java index bb18bb2f9a..dc715513ee 100644 --- a/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java @@ -122,7 +122,7 @@ public class LocalIndexHelper { info.setCorrupted(true); info.setDescription(result.warning); } else { - int totalDistance = 0; + float totalDistance = 0; int totalTracks = 0; long startTime = Long.MAX_VALUE; long endTime = Long.MIN_VALUE; @@ -175,8 +175,8 @@ public class LocalIndexHelper { diffElevationDown -= diff; } } - // fix Issue 1946(5), try using distanceBetween instead of haversine: //totalDistance += MapUtils.getDistance(prev.lat, prev.lon, point.lat, point.lon); + // using ellipsoidal 'distanceBetween' instead of spherical haversine (MapUtils.getDistance) should be more exact, but likely makes no practical difference: net.osmand.Location.distanceBetween(prev.lat, prev.lon, point.lat, point.lon, calculations); totalDistance += calculations[0]; }