1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Fixed broken distance re-computation

This commit is contained in:
Martin Tůma 2019-02-12 00:20:39 +01:00
parent a882d1fe68
commit cd74b0d43e

View File

@ -145,7 +145,7 @@ Track::Track(const TrackData &data) : _data(data), _pause(0)
break;
}
for (int j = last + 1; j < sd.size(); j++) {
if (seg.outliers.contains(i))
if (seg.outliers.contains(j))
continue;
if (discardStopPoint(seg, j)) {
seg.distance[j] = seg.distance.at(last);
@ -155,8 +155,8 @@ Track::Track(const TrackData &data) : _data(data), _pause(0)
sd.at(last).coordinates());
seg.distance[j] = seg.distance.at(last) + ds;
dt = seg.time.at(i) - seg.time.at(last);
seg.speed[i] = (dt < 1e-3) ? seg.speed.at(last) : ds / dt;
dt = seg.time.at(j) - seg.time.at(last);
seg.speed[j] = (dt < 1e-3) ? seg.speed.at(last) : ds / dt;
}
last = j;
}