From 96f60cf1b7b1c2df9c5971d473b2d5313564ed39 Mon Sep 17 00:00:00 2001 From: Jan-Henrik Bruhn Date: Tue, 10 Mar 2026 09:44:28 +0100 Subject: [PATCH] fix: wrong transit ingest dir was used --- worker/src/jobs/build-valhalla.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/worker/src/jobs/build-valhalla.ts b/worker/src/jobs/build-valhalla.ts index 565d857..2005662 100644 --- a/worker/src/jobs/build-valhalla.ts +++ b/worker/src/jobs/build-valhalla.ts @@ -29,11 +29,20 @@ const GTFS_DATA_DIR = process.env.GTFS_DATA_DIR ?? `${VALHALLA_DATA_DIR}/gtfs`; const TIMEZONE_SQLITE = `${VALHALLA_DATA_DIR}/timezone.sqlite`; const ADMINS_SQLITE = `${VALHALLA_DATA_DIR}/admins.sqlite`; -/** Per-city GTFS feed dir written by download-gtfs. */ +/** Per-city GTFS feed dir written by download-gtfs (contains .txt files). */ function cityGtfsFeedDir(citySlug: string): string { return `${GTFS_DATA_DIR}/${citySlug}/feed`; } +/** + * Parent directory passed as transit_feeds_dir to Valhalla. + * Valhalla expects transit_feeds_dir to contain subdirectories — one per GTFS feed. + * Our structure: .../gtfs/{citySlug}/feed/{*.txt}, so the parent is .../gtfs/{citySlug}. + */ +function cityGtfsFeedsParentDir(citySlug: string): string { + return `${GTFS_DATA_DIR}/${citySlug}`; +} + /** * Per-city transit staging directory. * valhalla_ingest_transit writes PBF staging tiles here. @@ -138,7 +147,7 @@ function writeCityTransitIngestConfig(citySlug: string): string { timezone: TIMEZONE_SQLITE, admin: ADMINS_SQLITE, transit_dir: cityTransitCacheDir(citySlug), - transit_feeds_dir: cityGtfsFeedDir(citySlug), + transit_feeds_dir: cityGtfsFeedsParentDir(citySlug), }, service_limits: { isochrone: { max_contours: 5 } }, } as JsonObject); @@ -163,7 +172,7 @@ function writeCityConfig(citySlug: string, cityTileDir: string): string { admin: ADMINS_SQLITE, ...(INCLUDE_TRANSIT ? { transit_dir: cityTransitCacheDir(citySlug), - transit_feeds_dir: cityGtfsFeedDir(citySlug), + transit_feeds_dir: cityGtfsFeedsParentDir(citySlug), } : {}), }, additional_data: { elevation: "/data/elevation/" },