Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions gtfs-routes-service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down