有没有办法用 GTFS 确定旅行发生在哪一天?

Is there a way to determine which day a trip occurs with GTFS?

我正在尝试制作一个可以向用户显示路线图和当天日程安排的网站。问题是在 stop_times.txt 文件中,它显示了每次停站的每个停站时间,但没有显示它发生在哪一天。我如何才能确定旅行发生在哪一天?

例如,这是我排序的一些数据:

trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_type,drop_off_type,shape_dist_traveled,timepoint
'16873083', '05:52:00', '05:52:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'
'16873084', '06:23:00', '06:23:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'
'16873085', '06:52:00', '06:52:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'
...
'16873119', '23:44:00', '23:44:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'
'16873120', '24:44:00', '24:44:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'
'16873124', '06:36:00', '06:36:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'
'16873125', '07:08:00', '07:08:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'
'16873126', '16:11:00', '16:11:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'

然后它重复一次然后有一堆不同的时间我认为是周末时间表:

'16861123', '05:43:00', '05:43:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'
'16861124', '06:43:00', '06:43:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'
'16861125', '07:43:00', '07:43:00', '9257', '31', '79 Century Park', '0', '0', '9535.3', '0'
...

我已将 stop_times.txt 中的数据分离到每个站点的单独文件中。但是,正如您在上面看到的那样,对于 6,000 多个 stops/files.

,手动找出文件的每个部分代表哪一天是非常困难的。

有什么办法可以做到吗?

从行程图中可以看出,stop_times trip_id 引用了行程 table。在行程 table 中,service_id 引用日历 table,它告诉您行程在指定的开始日期和结束日期之间运行的日期。这可以通过指定例外情况进一步调整,例如 calendar_dates 中的 public 假期。如需完整了解规范,请访问

https://developers.google.com/transit/gtfs/reference

应该阅读。