MobilityData / gtfs-realtime-validator

Java-based tool that validates General Transit Feed Specification (GTFS)-realtime feeds
Other
41 stars 10 forks source link

Frequency-based exact_times = 1 trips must contain trip_id, start_time, and start_date #38

Open barbeau opened 2 years ago

barbeau commented 2 years ago

Issue by barbeau Wednesday Apr 26, 2017 at 14:41 GMT Originally opened as https://github.com/CUTR-at-USF/gtfs-realtime-validator/issues/163


Summary:

TripDescriptor field must contain trip_id, start_time, and start_date if the trip is defined in GTFS frequencies.txt with exact_times=1. If the TripDescriptor doesn't contain trip_id, start_time, and start_date, this is an error. See https://developers.google.com/transit/gtfs-realtime/reference/TripDescriptor.

Note we have E006 for frequency-based exact_times = 0 trips implemented in FrequencyTypeZeroValidator which is this same concept but for exact_times=0 trips, but I'd prefer to separate these into two different errors to draw out the distinctions for the two types of trips. So, this new rule would be implemented in FrequencyTypeOneValidator, with the unit tests being implemented in FrequencyTypeOneValidatorTest.

barbeau commented 2 years ago

Comment by barbeau Friday Jul 07, 2017 at 20:34 GMT


Here's the commit that added rule E006 (as well as a few other related rules), which is a good reference for what pieces of information (rule, documentation, unit tests) need to be added to the project for each new rule - https://github.com/CUTR-at-USF/gtfs-realtime-validator/commit/51a4d5f7ee63a4beb7f4ff03b671bdc29c55244c. Note that some of this code has since been refactored, so please take a look at the master branch for FrequencyTypeZeroValidator and FrequencyTypeOneValidator to see the most recent version of the code.

barbeau commented 2 years ago

Comment by barbeau Friday Jul 07, 2017 at 20:39 GMT


@Suryakandukoori This is probably a good rule to start on, in terms of implementing new rules for the first time. It mirrors the existing rule E006, but for a different set of trips in a GTFS feed (see above for more info).

Please take a look and let me know if you have any questions.

e-lo commented 2 years ago

Relevant Best Practice:

For trips denoted in GTFS frequency.txt as frequency-based by setting exact_times=0 or omitting the exact_times field In TripUpdate.StopTimeUpdate, all of trip_idstart_time, and start_date must be provided when describing trip in TripUpdate or VehiclePosition by using TripDescriptor.