aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-09-24 08:37:33 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-09-24 08:37:33 +0200
commit90614736f2a0c556f31eca5361b3c032f5f309f6 (patch)
tree81fda954dc2bff8ae8b0023b502343c455995272 /main.go
parente3d0beee5be3dd2854b0f4fc10905a4fcdc08f47 (diff)
Match official climbs against their recorded sample
An official climb matched on endpoint coordinates alone. On a loop ridden the other way the route meets the climb's top before its bottom, so pairing each start with the first end inside its lap window credited a 5.9 km passage as the 850 m Chemin de la Tour Pey Blanc, and a 49 km one on another ride. Climbs now keep the sample of the segment they were created from: the recorded length and elevation gain of the selected route points, captured by the ride detail and preview handlers and stored NOT NULL. Matching takes the whole route and drops any candidate outside ±50% of that sample on either axis, and attempts are refreshed by upsert and prune so re-analyzing a ride keeps the recorded-at stamp of the passages that survive. The backfill leaves the web package: backfill.Run recomputes ride values then official climb attempts as a single `go run . backfill` command (climbs-backfill is gone), rideanalysis owns the attempt snapshot, and the mountain-pass loading margin is shared. Applied to the stored rides it stamps 78 samples, drops the four bogus attempts and leaves ride 800 with its three Pont Rout passages.
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/main.go b/main.go
index 8befddc..d475a90 100644
--- a/main.go
+++ b/main.go
@@ -8,6 +8,7 @@ import (
"os"
"github.com/grafana/pyroscope-go"
+ "github.com/martinlehoux/biking_home/backfill"
"github.com/martinlehoux/biking_home/config"
"github.com/martinlehoux/biking_home/mountain_pass"
"github.com/martinlehoux/biking_home/ride"
@@ -55,9 +56,7 @@ func runCommand(db *sql.DB, configPath string, appConfig config.Config, args []s
}
mountain_pass.ExtractOSM(db, args[1])
case "backfill":
- ride.BackfillCmd(db)
- case "climbs-backfill":
- web.BackfillOfficialClimbAttemptsCmd(db, configPath)
+ backfill.Run(db, configPath)
case "backtest":
ride.BacktestCmd(db)
case "elevation":
@@ -89,8 +88,7 @@ Commands:
serve start web server (default when no command given)
fetch-osm download the France OSM PBF into france-latest.osm.pbf
extract-osm <path> extract mountain passes from an OSM PBF file
- backfill recompute all stored ride values
- climbs-backfill record official climb attempts for every stored ride
+ backfill recompute stored ride values and record official climb attempts
backtest run data benchmarks comparing computed values against stored reference values
elevation analyse detect elevation outliers (tunnel spikes)
elevation fix linearly fix elevation between anchors