gtfs-validator icon indicating copy to clipboard operation
gtfs-validator copied to clipboard

Implement trip sequence duplicate verification (GTFS rule)

Open maximearmstrong opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. A stop should not be duplicated in a trip stop sequence. This is a GTFS rule implemented in Google Python validator and featured in Google Type Error as TYPE_TRIP_DUPLICATES and TYPE_TRIP_WITH_DUPLICATE_STOPS.

Describe the solution you'd like Actual Google GTFS validator behaviour : verifies if a trip does not have multiple route types or does not have a duplicated stop in its stop sequence. https://github.com/google/transitfeed/blob/master/transitfeed/trip.py#L575

Describe alternatives you've considered

Additional context Line 130 and 146 in Error support priorities https://docs.google.com/spreadsheets/d/1vqe6wq7ctqk1EhYkgtZ0_TbcQ91vccfs2daSjn20BLE/edit#gid=0

maximearmstrong avatar May 04 '20 15:05 maximearmstrong

@maximearmstrong Could you explain the implementation details of this one a little more, or link to the Python code?

I'm curious to know to what extent trips are tested to be the "same".

barbeau avatar May 04 '20 19:05 barbeau

I rephrased the explanation above and added a link. A stop should not be duplicated in a trip stop sequence.

maximearmstrong avatar May 04 '20 20:05 maximearmstrong

Ah, ok, thanks - so stop_sequence should be unique within a trip - that makes sense.

barbeau avatar May 06 '20 21:05 barbeau

@fabrice-v If this rule is checking for duplicate stop_sequence values within a trip, it's in spec.

barbeau avatar Aug 04 '20 21:08 barbeau

I think this is covered now that we have introduced keys in the spec. The primary key of stop_times.txt is (trip_id, stop_sequence). If we have a duplicate value for stop_sequence for one trip, the validator will emit the duplicate_key notice

isabelle-dr avatar Oct 03 '22 19:10 isabelle-dr