Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-07-18 17:05:57 +02:00
commit 7f63cf1464

View file

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