From ff10084ba0d416ca11e0738fcff4d016eba782df Mon Sep 17 00:00:00 2001 From: slothful-vassal <89943360+slothful-vassal@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:43:04 +0100 Subject: [PATCH] skip elevation correction if no valid height information returned by valhalla (#821) --- web/src/lib/models/gpx/gpx.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/src/lib/models/gpx/gpx.ts b/web/src/lib/models/gpx/gpx.ts index ed364e5d..8ccd01bb 100644 --- a/web/src/lib/models/gpx/gpx.ts +++ b/web/src/lib/models/gpx/gpx.ts @@ -195,6 +195,12 @@ export default class GPX { } const heightResponse: ValhallaHeightResponse = await r2.json() + const heights = heightResponse.height ?? []; + const finiteHeights = heights.filter((height) => Number.isFinite(height)).length; + + if (heights.length > 0 && finiteHeights === 0) { + return; + } let heightIndex = 0; for (const track of this.trk ?? []) {