Frage

Suppose i have one bus, which departures at 08:00 and 10:00.

Since the bus uses the same stops, stop_sequence, should i split the trip to a specific stop_time, or can i use the same trip_id for multiple stop_times.

Example:

TripA - Stop_timesA (Departures at 08:00, TripA), Stop_timesB (Departures at 10:00, TripA)

Or

TripA - Stop_timesA (Departures at 08:00, TripA)
TripB - Stop_timesB (Departures at 10:00, TripB)


Thanks.

War es hilfreich?

Lösung

Generally, you'd use separate trips.

For example, if the two stop-times both belonged to the same trip AND had the same stop_sequence values, it'd typically be considered a validation error, since stop_sequence should be unique for each stop-time in the same trip.

Just to be clear, there is nothing wrong with having the same stop appear in the same trip more than once, especially for loop routes. However, if aren't modeling a loop route, you should use separate trips. Otherwise, you are saying that a rider can get on at the first stop-time and ride through all the intermediate stop-times and arrive at the same stop again two hours later. Maybe that's your case, but I'm guessing not.

Andere Tipps

According the specification for GTFS, "A trip is a sequence of two or more stops that occurs at specific time". This would indicate that each of the departures would be a separate trip and have a separate trip_id in the data set.

However, the question would indicate that each departure (or trip) should be on the same route.

It took me a while to really understand how GTFS really works. The spec is a good place to start and read carefully.

My answer is quite late, but... NO, you shouldn't.

The mechanism to "repeat" the same trip at different times on the same day is by using the frequencies table.

In your example, you would define a single TripA in both trips and stop_times tables.

On the frequencies table, you declare the start_time as "08:00:00", end_time as "11:59:59" and headway_secs as "7200" (two hours). All this means that the trips will run every 2 hours starting at 08:00:00, but no trip will start after 11:59:59 - so there will be only two trips starting at 08:00:00 and 10:00:00.

If you duplicate your trip by creating tripA and tripB, you have at least two problems:

  • all records will be duplicated on the stop_times table, making the GTFS file bigger/heavier if you have multiple stops and/or multiple trips on the same day
  • maintenance will be much more complicated - if one single stop is changed, you have to change it in all trip "clones"
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top