bug fix in min/max elevation

This commit is contained in:
sonora 2011-08-23 03:21:36 +03:00
parent a9d7b0b684
commit a7d21c3089

View file

@ -115,6 +115,7 @@ public class LocalIndexHelper {
double diffElevationUp = 0; double diffElevationUp = 0;
double diffElevationDown = 0; double diffElevationDown = 0;
double totalElevation = 0; double totalElevation = 0;
double Elevation = 0;
double minElevation = 99999; double minElevation = 99999;
double maxElevation = 0; double maxElevation = 0;
@ -140,9 +141,10 @@ public class LocalIndexHelper {
speedCount ++; speedCount ++;
} }
totalElevation += subtrack.get(j).getAltitude(); Elevation = subtrack.get(j).getAltitude();
minElevation = Math.min(totalElevation, minElevation); totalElevation += Elevation;
maxElevation = Math.max(totalElevation, maxElevation); minElevation = Math.min(Elevation, minElevation);
maxElevation = Math.max(Elevation, maxElevation);
if (j > 0) { if (j > 0) {
double diff = subtrack.get(j).getAltitude() - subtrack.get(j - 1).getAltitude(); double diff = subtrack.get(j).getAltitude() - subtrack.get(j - 1).getAltitude();
if(diff > 0){ if(diff > 0){