fix rounding of average speed in GPX analysis
This commit is contained in:
parent
dc2529acf0
commit
c8f20c0605
1 changed files with 3 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
|||
|
||||
package net.osmand.plus;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
|
@ -305,9 +306,9 @@ public class GPXUtilities {
|
|||
// 5. Max speed and Average speed, if any. Average speed is NOT overall (effective) speed, but only calculated for "moving" periods.
|
||||
if(speedCount > 0) {
|
||||
if(timeMoving > 0){
|
||||
avgSpeed = (float) (totalDistanceMoving / timeMoving * 1000);
|
||||
avgSpeed = (float)totalDistanceMoving / (float)timeMoving * 1000;
|
||||
} else {
|
||||
avgSpeed = (float) (totalSpeedSum / speedCount);
|
||||
avgSpeed = (float)totalSpeedSum / (float)speedCount;
|
||||
}
|
||||
} else {
|
||||
avgSpeed = -1;
|
||||
|
|
Loading…
Reference in a new issue