fix: wrong transit ingest dir was used
This commit is contained in:
parent
e60debd10c
commit
96f60cf1b7
1 changed files with 12 additions and 3 deletions
|
|
@ -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 TIMEZONE_SQLITE = `${VALHALLA_DATA_DIR}/timezone.sqlite`;
|
||||||
const ADMINS_SQLITE = `${VALHALLA_DATA_DIR}/admins.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 {
|
function cityGtfsFeedDir(citySlug: string): string {
|
||||||
return `${GTFS_DATA_DIR}/${citySlug}/feed`;
|
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.
|
* Per-city transit staging directory.
|
||||||
* valhalla_ingest_transit writes PBF staging tiles here.
|
* valhalla_ingest_transit writes PBF staging tiles here.
|
||||||
|
|
@ -138,7 +147,7 @@ function writeCityTransitIngestConfig(citySlug: string): string {
|
||||||
timezone: TIMEZONE_SQLITE,
|
timezone: TIMEZONE_SQLITE,
|
||||||
admin: ADMINS_SQLITE,
|
admin: ADMINS_SQLITE,
|
||||||
transit_dir: cityTransitCacheDir(citySlug),
|
transit_dir: cityTransitCacheDir(citySlug),
|
||||||
transit_feeds_dir: cityGtfsFeedDir(citySlug),
|
transit_feeds_dir: cityGtfsFeedsParentDir(citySlug),
|
||||||
},
|
},
|
||||||
service_limits: { isochrone: { max_contours: 5 } },
|
service_limits: { isochrone: { max_contours: 5 } },
|
||||||
} as JsonObject);
|
} as JsonObject);
|
||||||
|
|
@ -163,7 +172,7 @@ function writeCityConfig(citySlug: string, cityTileDir: string): string {
|
||||||
admin: ADMINS_SQLITE,
|
admin: ADMINS_SQLITE,
|
||||||
...(INCLUDE_TRANSIT ? {
|
...(INCLUDE_TRANSIT ? {
|
||||||
transit_dir: cityTransitCacheDir(citySlug),
|
transit_dir: cityTransitCacheDir(citySlug),
|
||||||
transit_feeds_dir: cityGtfsFeedDir(citySlug),
|
transit_feeds_dir: cityGtfsFeedsParentDir(citySlug),
|
||||||
} : {}),
|
} : {}),
|
||||||
},
|
},
|
||||||
additional_data: { elevation: "/data/elevation/" },
|
additional_data: { elevation: "/data/elevation/" },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue