Best practices for stop_times.txt

131 views
Skip to first unread message

Allison DeJong

unread,
Sep 12, 2011, 3:51:32 PM9/12/11
to transit-d...@googlegroups.com
Hello all,

I work for a smaller transit agency and have put together a preliminary GTFS feed - but I know zero programming languages so I did it all in Excel. (There was a lot of copy/pasting.) To cut down on some of the hours required, I did not parse out separate trips for inbound/outbound service and did not use block IDs. Instead, if there was a continuous "trip" from the rider's perspective - no vehicle change, but a possible driver change - I kept it all as one trip.

So for a route that runs one bus on a weekday, with a vehicle change halfway through, I coded it as only two trips. While this looks a little odd to have several times per stop listed in the schedule viewer tool, I would think it would still operate properly for trip planning, but I'm not sure. The feed validated properly.

Because I'm not sure if I did this correctly, I'm considering going back and subdividing all the trips in stop_times. I'd have to do this manually for 43,000 rows of text.

--Is it necessary from a trip planning perspective to go back and do this?
--If so, how do I deal with a route where the bus waits at a given endpoint for a certain length of time? In a continuous stop_time, that's easy enough: Use one stop_id, and have different arrival and departure times (Right now an example stop looks like this: E3WE1A,5:30:00,5:32:00,KLNO5,17,0,0). If I would split it in two trips, how should it look?

E3WE1A,5:30:00,5:30:00,KLNO5,17,0,0
E3WE1B,5:32:00,5:32:00,KLNO5,1,0,0

or maybe like this? 

E3WE1A,5:30:00,5:32:00,KLNO5,17,0,0
E3WE1B,5:30:00,5:32:00,KLNO5,1,0,0

--And is there an easier way to do this (there must be) than using Excel?  

Sorry for what must be a ridiculous question, but I'm trying to do it right the first time while learning along the way.

Thanks,
allison

Devin Braun

unread,
Sep 12, 2011, 4:19:43 PM9/12/11
to transit-d...@googlegroups.com

Hi Allison,

 

It’s a good idea to split each trip up into individual trip_ids each time the bus gets to the end of the line.  I think the way you’ve done it will work, but it’s a different way to do it.  What does the headsign of the bus say for each trip?  Does it change?  When Google’s Trip Planner gives directions, it tells you to take the Bus XX towards YY.  So if your headsign is something generic for the bus, it might not be that helpful to passengers.

 

Also, if you decide to include shapes in your feed, you’ll need to separate out each direction in order for the shape to be drawn correctly and then assign those shapes to trips.

 

If you have clock headways in your transit system (like a lot of small agencies do) where the bus always departs at the same time each hour, or buses depart from the starting point at a fixed number of minutes all day long, you can build your feed using the frequencies.txt file.  This file can turn thousands of records into just a few lines per route. 

 

In your examples, you didn’t put the column names for each field, but if you do split the trips, you’d put the final stop sequence at the stop_id and start the next trip with a new trip_id, stop_sequence = 1, and a new departure time. 

 

There are several 3rd-party software companies who will be glad to assist you in getting your feed up and running with their software, but they aren’t free.

 

Devin

San Diego MTS

--
You received this message because you are subscribed to the Google Groups "Transit Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/transit-developers/-/fET1Dngxp_AJ.
To post to this group, send email to transit-d...@googlegroups.com.
To unsubscribe from this group, send email to transit-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/transit-developers?hl=en.

Allison DeJong

unread,
Sep 12, 2011, 4:38:49 PM9/12/11
to transit-d...@googlegroups.com
Devin,

Our headsigns only display the route name, so there's no added benefit there, as you said. We do not run on a fixed headway schedule, and some of the routes add more service from different points along the route during peak hours.

I haven't made the leap to shapes yet. That will probably come in a later update to the feed.

And you're right, I didn't include headers - for the example posted above they are:
trip_id,arrival_time,departure_time,stop_id,stop_sequence,pickup_type,drop_off_type

With that example, I was trying to determine if how to split the arrival and departure times when the bus waits at a given end point for a given length of time - i.e. if the end of the inbound route and the beginning of the outbound route are the same, but the bus sits a while and waits for passengers, does the inbound trip end at the arrival time and the outbound trip begin at the departure time?

Thanks again,
allison

Tom Brown

unread,
Sep 12, 2011, 7:47:35 PM9/12/11
to transit-d...@googlegroups.com
Building a GTFS file manually sounds like an educational experience but I wouldn't want to maintain one manually without more tools. Bob recently updated his XLS Tools for Google Transit http://groups.google.com/group/googletransit/browse_thread/thread/97287634679f04ca

On Mon, Sep 12, 2011 at 1:19 PM, Devin Braun <Devin...@sdmts.com> wrote:

There are several 3rd-party software companies who will be glad to assist you in getting your feed up and running with their software, but they aren’t free.


There are a few listed on the following page. Some have free limited versions.

Matt Conway

unread,
Sep 12, 2011, 11:15:23 PM9/12/11
to transit-d...@googlegroups.com
How do you maintain your schedules? There may be a more automated way to convert them to GTFS.

--
You received this message because you are subscribed to the Google Groups "Transit Developers" group.

Aaron Antrim

unread,
Sep 12, 2011, 4:33:30 PM9/12/11
to transit-d...@googlegroups.com
Hi Allison,

Devin provides some good feedback regarding issues with shapes.txt and trip_headsign data when using your approach of one singular trip.  Will frequencies.txt (http://code.google.com/transit/spec/transit_feed_specification.html#frequencies_txt___Field_Definitions) be useful to minimize effort to maintain trips and stop_times records?

It seems as if the GTFS you are creating would be functional for trip planning.  Are there any developers of GTFS feed consuming applications that could further answer this question?  Are applications (say those that show timetables in mobile devices) for which this approach would be an issue?

Finally, my company, Trillium Solutions, offers services and software to help public transportation agencies create and maintain GTFS.  Let us know if we can be of assistance.

Cheers,
Aaron

-- 
Aaron Antrim
Trillium Solutions, Inc.
Portland, Oregon

--
You received this message because you are subscribed to the Google Groups "Transit Developers" group.

Brian Ferris

unread,
Sep 13, 2011, 4:28:32 PM9/13/11
to transit-d...@googlegroups.com
It's also worth noting that the 'exact_times' feature of
frequencies.txt has been officially added to the spec. This can
additionally help when you need to easily define a number of
regularly-repeating trips.

Thanks,
Brian

Reply all
Reply to author
Forward
0 new messages