TheTransitClock / transitime

TheTransitClock real-time transit information system
GNU General Public License v3.0
78 stars 29 forks source link

`start_date` for trips departing >24:00:00 #275

Open felixguendling opened 11 months ago

felixguendling commented 11 months ago

Consider the following dataset:

# calendar.txt
service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
3,0,0,0,0,0,0,1,20230724,20231112

# trips.txt
route_id,trip_id,service_id,trip_headsign,direction_id,block_id,shape_id,drt_advance_book_min,peak_offpeak
27838,5469130,3,246 - OWL to N. Miami Beach,1,1487116,196724,0.0,0

# input/schedule/dade/stop_times.txt
trip_id,stop_id,arrival_time,departure_time,timepoint,stop_sequence,shape_dist_traveled,continuous_pickup,continuous_drop_off,start_service_area_radius,end_service_area_radius,departure_buffer
5469130,1340,28:10:00,28:10:00,1,1,,-999,-999,-999.0,-999.0,0
5469130,6648,28:11:34,28:11:34,0,2,0.7173,-999,-999,-999.0,-999.0,0

Note that trip 5469130 has a first departure on Sundays, e.g. 2023-08-06at 28:10:00. There is no additional exception (calendar_dates.txt).

Expected functionality The produced GTFS-RT message should address the trip 5469130 with start_date=20230806 (even if the first departure is on 20230807). This is the matching GTFS-static vs GTFS-RT according to @derhuest answer in the official repository: https://github.com/google/transit/issues/381

Describe the bug

The trip (which only operates on Sundays!) is reported to run on 20230807 which is a Monday. Even if the first departure is at 04:10, Monday, it is necessary to use the start_date=20230806. So the following GTFS-RT message is referring to a trip that does not exist.

{
 "header": {
  "gtfsRealtimeVersion": "1.0",
  "incrementality": "FULL_DATASET",
  "timestamp": "1691392753"
 },
 "entity": [
  {
   "id": "5469130",
   "tripUpdate": {
    "trip": {
     "tripId": "5469130",
     "startDate": "20230807",
     "scheduleRelationship": "SCHEDULED",
     "routeId": "27838"
    },
    [...]
}

To Reproduce Produce a GTFS-RT message for a trip departing at a time >= 24:00:00. This will result in a wrong start_date.

Screenshots

Version:

Configuration:

Additional context

Chay2203 commented 4 months ago

Hey @scrudden I would love to work on this issue, can you please assign me to this :)