From 78317747030ef4b1b8e7fe19cec7f7ebd7d9013d Mon Sep 17 00:00:00 2001 From: vcoppe Date: Sun, 2 Feb 2025 11:43:56 +0100 Subject: [PATCH] handle files with uniform timestamps --- gpx/src/gpx.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gpx/src/gpx.ts b/gpx/src/gpx.ts index 064bfc17..f1cadecc 100644 --- a/gpx/src/gpx.ts +++ b/gpx/src/gpx.ts @@ -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);