stride-api: Add an api that will add the "src_city" and "dst_city" for every gtfs_route
#311 opened on Dec 16, 2023
Repository metrics
- Stars
- (95 stars)
- PR merge metrics
- (PR metrics pending)
Description
Currently, we only have the gtfs_route.route_long_name, which is a string containg the first and last stops nickname, and a seperating string - <->. For example, this is how we currently use it in the UI -
.
We do not have a way to filter based on the direct city name (e.g. "show me all the routes that start or finish in Jerusalem").
Why is this important?
- This can help us create new filters, and therefore statistics \ scoring, based on the city.
How it can be implemented?
In some routes, the city name appears in the string, but as far as I know it is not guranteed. So, 2 suggestions I have here, but fill free to suggest more:
- Get the coordinates of the first and last stop in each route (using gtfs_ride_stop.stop_sequence), and using google geo api (or other options), query the city name.
- Using GPT, when the input is the split route_long_name. I think this is a bit of a long shot that will create some false positives when the exact city name is not in the route_long_name, but mentioning this anyway as an option 😅
An even greater implementation could be adding an ETL, that will add a column in the DB to the gtfs_route table, so that this logic won't be done in runtime, and reachable by any of the APIs.