aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-21 10:30:27 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-21 10:30:27 +0200
commit44f7333d9deef81d3468e20b378c63692a9406ec (patch)
treeaeacb99247dba4e48ee61e2792f5476a3770795a /cli
parent6667ee479c06c14bb182f36a0a9ee704fca6218d (diff)
Use OSM as the single source of mountain passes
Replace the centcols CSV download/enrichment pipeline with OSM PBF extraction as the primary (only) source: merge osmpass into mountain_pass, drop the centcols table and model fields, filter to named passes with elevation, and remove the centcols CLI flags.
Diffstat (limited to 'cli')
-rw-r--r--cli/cli.go26
1 files changed, 6 insertions, 20 deletions
diff --git a/cli/cli.go b/cli/cli.go
index 3a04b8b..3f291bb 100644
--- a/cli/cli.go
+++ b/cli/cli.go
@@ -15,7 +15,6 @@ import (
"github.com/martinlehoux/biking_home/config"
"github.com/martinlehoux/biking_home/mountain_pass"
- "github.com/martinlehoux/biking_home/osmpass"
"github.com/martinlehoux/biking_home/ride"
"github.com/martinlehoux/biking_home/rides"
"github.com/martinlehoux/biking_home/web"
@@ -23,14 +22,10 @@ import (
)
var (
- download = flag.Bool("download", false, "download mountain passes into the database")
- resume = flag.Bool("resume", false, "skip departments already cached on disk")
- importCache = flag.Bool("import-cached", false, "import cached department CSVs into the database")
- fetchOSM = flag.Bool("fetch-osm", false, "download the France OSM PBF (resumable) into france-latest.osm.pbf")
- extractOSM = flag.String("extract-osm", "", "extract mountain passes from an OSM PBF file into the database")
- enrich = flag.Bool("enrich", false, "backfill mountain pass coordinates from OSM data")
- backfill = flag.Bool("backfill", false, "recompute all stored ride values")
- backtest = flag.Bool("backtest", false, "run data benchmarks comparing computed values against stored reference values")
+ fetchOSM = flag.Bool("fetch-osm", false, "download the France OSM PBF (resumable) into france-latest.osm.pbf")
+ extractOSM = flag.String("extract-osm", "", "extract mountain passes from an OSM PBF file into the database")
+ backfill = flag.Bool("backfill", false, "recompute all stored ride values")
+ backtest = flag.Bool("backtest", false, "run data benchmarks comparing computed values against stored reference values")
)
const (
@@ -40,21 +35,12 @@ const (
func Run(db *sql.DB, configPath string, appConfig config.Config) {
switch {
- case *download:
- err := mountain_pass.DownloadMountainPasses(db, 5*time.Second, *resume)
- kcore.Expect(err, "failed to download mountain passes")
- case *importCache:
- _, err := mountain_pass.ImportCachedDepartments(db, []string{"06", "13"})
- kcore.Expect(err, "failed to import cached departments")
case *fetchOSM:
- err := osmpass.FetchFrancePBF("france-latest.osm.pbf")
+ err := mountain_pass.FetchFrancePBF("france-latest.osm.pbf")
kcore.Expect(err, "failed to download France OSM PBF")
case *extractOSM != "":
- _, err := osmpass.ExtractMountainPasses(context.Background(), *extractOSM, db)
+ _, err := mountain_pass.ExtractMountainPasses(context.Background(), *extractOSM, db)
kcore.Expect(err, "failed to extract mountain passes from OSM")
- case *enrich:
- _, err := osmpass.EnrichMountainPasses(db)
- kcore.Expect(err, "failed to enrich mountain passes")
case *backfill:
count, err := rides.Backfill(db)
kcore.Expect(err, "failed to backfill ride values")