hasadna/open-bus-map-search

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

オープン

#311 opened on 2023/12/16

 (12 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (125 件のフォーク)auto 404
backendgood first issue

Repository metrics

Stars
 (95 個のスター)
PR merge metrics
 (平均マージ 6d 5h) (30d で 42 merged PRs)

説明

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.

コントリビューターガイド