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:
parent
a882d1fe68
commit
cd74b0d43e
@ -145,7 +145,7 @@ Track::Track(const TrackData &data) : _data(data), _pause(0)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (int j = last + 1; j < sd.size(); j++) {
|
for (int j = last + 1; j < sd.size(); j++) {
|
||||||
if (seg.outliers.contains(i))
|
if (seg.outliers.contains(j))
|
||||||
continue;
|
continue;
|
||||||
if (discardStopPoint(seg, j)) {
|
if (discardStopPoint(seg, j)) {
|
||||||
seg.distance[j] = seg.distance.at(last);
|
seg.distance[j] = seg.distance.at(last);
|
||||||
@ -155,8 +155,8 @@ Track::Track(const TrackData &data) : _data(data), _pause(0)
|
|||||||
sd.at(last).coordinates());
|
sd.at(last).coordinates());
|
||||||
seg.distance[j] = seg.distance.at(last) + ds;
|
seg.distance[j] = seg.distance.at(last) + ds;
|
||||||
|
|
||||||
dt = seg.time.at(i) - seg.time.at(last);
|
dt = seg.time.at(j) - seg.time.at(last);
|
||||||
seg.speed[i] = (dt < 1e-3) ? seg.speed.at(last) : ds / dt;
|
seg.speed[j] = (dt < 1e-3) ? seg.speed.at(last) : ds / dt;
|
||||||
}
|
}
|
||||||
last = j;
|
last = j;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user