From 3c3939c5253167f3e030aa823daea2f6d9c8b8aa Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Thu, 31 Oct 2024 11:29:08 +0100 Subject: [PATCH] Not all stations have UIC, use name instead --- agenda/trip.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agenda/trip.py b/agenda/trip.py index 95dd802..8cab498 100644 --- a/agenda/trip.py +++ b/agenda/trip.py @@ -237,9 +237,9 @@ def get_locations(trip: Trip) -> dict[str, StrDict]: locations["ferry_terminal"][terminal["name"]] = terminal for s in station_list: - if s["uic"] in locations["station"]: + if s["name"] in locations["station"]: continue - locations["station"][s["uic"]] = s + locations["station"][s["name"]] = s return locations @@ -336,7 +336,7 @@ def get_trip_routes(trip: Trip, data_dir: str) -> list[StrDict]: assert t["type"] == "train" for leg in t["legs"]: train_from, train_to = leg["from_station"], leg["to_station"] - geojson_filename = train_from.get("routes", {}).get(train_to["uic"]) + geojson_filename = train_from.get("routes", {}).get(train_to["name"]) key = "_".join(["train"] + sorted([train_from["name"], train_to["name"]])) if not geojson_filename: routes.append(