Question about Non-Continuous stop_sequence and Duplicate Stop IDs in GTFS Data

Hello,

I am working with GTFS data and encountered an issue when retrieving stoptime data for certain tripIDs. Specifically, I noticed that the stop_sequence values are not continuous, and there are instances where the same stop_id appears multiple times with different stop_sequence values, like the following example:

Can anyone help explain why this happens? Is this a normal occurrence in GTFS data, or could it indicate an issue with the data? Any insights would be greatly appreciated!

Thank you!

Hi,

Yes, it is common (atleast in the bus world) for the same stop_id to appear multiple times in the trip stopping pattern in stop_times.txt.

These are services where the bus would usually loop back to pick up passengers from the same bus stop again.

E.g. S360 school bus service stops are stop_id 251527 at 15:47:19 and then again at 15:49:45

In regards to the non-continuous stop sequencing, that I’m not sure.
Which GTFS data set are you looking at?

Ta,

2 Likes

Hi,

There is nothing wrong with the non-continuous stop sequences. As per the GTFS, “The values must increase along the trip but do not need to be consecutive.”

Regarding stop_id appearing multiple times with different stop_sequence values, the stop_sequences aren’t required to be consistent between trips, only increasing for stops within a trip. If you are referring to the stop_ids just appearing multiple times, that’s because the two examples you attached are different trips. As herolychour said, also note that buses (and sometimes even trains) can have repeated stops.

2 Likes

I can understand that a stop may be visited multiple times within a trip.

I have re-selected a new dataset from November 28th, with route_type = 2 and route_short_name = SCO. The trip_id values are C188.954.161.64.H.4.87612642 and C190.954.161.64.H.4.87609106.

As I can see, the two trips have exactly the same stop sequence, but the station order (highlighted in yellow along the route) differs in the last few stops. Additionally, I noticed that the pickup_type for the second-to-last stop is different.