hasadna/open-bus-map-search

stride-api: Add an api that will add the "src_city" and "dst_city" for every gtfs_route

開放

#311 建立於 2023年12月16日

 (12 則留言) (0 個反應) (0 位負責人)TypeScript (125 個分叉)auto 404
backendgood first issue

倉庫指標

星標
 (95 顆星)
PR 合併指標
 (平均合併 6天 5小時) (30 天內合併 42 個 PR)

描述

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.

貢獻者指南