From 40ee9927c25302dc9e1bded8c40e9a1b7840b8d4 Mon Sep 17 00:00:00 2001 From: Akhilesh Bhadauriya Date: Fri, 13 Jun 2025 19:29:51 +0530 Subject: [PATCH] python/fixing-routes-isses --- gtfs-routes-service.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtfs-routes-service.py b/gtfs-routes-service.py index b1f0fed..41a99bd 100644 --- a/gtfs-routes-service.py +++ b/gtfs-routes-service.py @@ -599,8 +599,9 @@ async def get_stops(gtfs_id: str): if gtfs_id not in gtfs_data.stop_route_map: raise HTTPException(status_code=404, detail="GTFS ID not found") - # Return the first mapping for each stop since they are already deduplicated - return [mappings[0] for mappings in gtfs_data.stop_route_map[gtfs_id].values()] + # Return the first mapping for each stop, excluding those with '_' in stopCode + return [mappings[0] for mappings in gtfs_data.stop_route_map[gtfs_id].values() + if '_' not in mappings[0].stopCode] @app.get("/stop/{gtfs_id}/{stop_code}", response_model=List[RouteStopMapping]) async def get_stop(gtfs_id: str, stop_code: str):