handle files with uniform timestamps

This commit is contained in:
vcoppe
2025-02-02 11:43:56 +01:00
parent 52984d4b70
commit 7831774703

View File

@@ -2074,6 +2074,8 @@ function withArtificialTimestamps(
function getTimestamp(a: TrackPoint, b: TrackPoint, speed: number): Date {
if (a.time === undefined) {
return undefined;
} else if (speed === undefined) {
return new Date(a.time.getTime() + 1000);
}
let dist = distance(a.getCoordinates(), b.getCoordinates()) / 1000;
return new Date(a.time.getTime() + (1000 * 3600 * dist) / speed);