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.

贡献者指南