ReviewOS

stacks/wildloop

Compute real elevation gain from GPS (sim fabricates via Math.random, real GPS stays 0)

#953
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Problem

Simulated runs fabricate elevation with Math.round(Math.random()*12) (useRecorder.ts), and real GPS runs record elevation 0 because the track has no elevation and no elevation source is queried. Elevation gain is a core Strava metric.

Acceptance

  • Derive elevation from an elevation source (tile/elevation API or trail metadata) for real and simulated runs.
  • Persist computed elevation_gain; stop using random values.
9 days ago

Fixed in 5961939. The Math.round(Math.random()*12) per-point fabrication is gone. One accumulation path for both modes: positive altitude deltas above a 3 ft noise floor (ELEVATION_NOISE_FLOOR_FT in resources/functions/splits.ts). Manual runs feed the GPS coords.altitude (metres→feet); simulated runs feed a deterministic profile distributed from the trail's published total gain — a simulated Eagle Peak run ends at Eagle Peak's real 2,847 ft, every time. totalElevationGainFt (climbs only, descents ignored) is covered by the new verification suite. Note: desktop browsers usually report altitude: null, in which case gain is honestly 0 rather than invented — a tile-based elevation API for altitude-less tracks would be a future enhancement.

Sign in to comment on this issue.