using ellipsoidal 'distanceBetween' instead of spherical haversine (MapUtils.getDistance) is a little more exact, also seems slightly faster
This commit is contained in:
parent
d7c033de05
commit
0cf97ac820
1 changed files with 5 additions and 5 deletions
|
@ -137,7 +137,7 @@ public class LocalIndexHelper {
|
||||||
int speedCount = 0;
|
int speedCount = 0;
|
||||||
double totalSpeedSum = 0;
|
double totalSpeedSum = 0;
|
||||||
|
|
||||||
//float[] calculations = new float[1];
|
float[] calculations = new float[1];
|
||||||
|
|
||||||
int points = 0;
|
int points = 0;
|
||||||
for(int i = 0; i< result.tracks.size() ; i++){
|
for(int i = 0; i< result.tracks.size() ; i++){
|
||||||
|
@ -175,10 +175,10 @@ public class LocalIndexHelper {
|
||||||
diffElevationDown -= diff;
|
diffElevationDown -= diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
totalDistance += MapUtils.getDistance(prev.lat, prev.lon, point.lat, point.lon);
|
//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 makes little practical difference:
|
// using ellipsoidal 'distanceBetween' instead of spherical haversine (MapUtils.getDistance) is a little more exact, also seems slightly faster:
|
||||||
//net.osmand.Location.distanceBetween(prev.lat, prev.lon, point.lat, point.lon, calculations);
|
net.osmand.Location.distanceBetween(prev.lat, prev.lon, point.lat, point.lon, calculations);
|
||||||
//totalDistance += calculations[0];
|
totalDistance += calculations[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue