Intelligent Transportation Systems

T3 Webinar:

5/14/2008 - How to Implement the TimeTable Publisher: An Open Source Application for Transit Agencies

Question and Answer Transcript

May 14, 2008

Back to Webinar Files

Q. Would it be possible for a person to click on one stop for the pick-up and click on another stop for the drop-off and have it calculate the fare based on that?

A.  Frank Purcell: It sounds like a great piece of functionality. It's nothing that I've written, but the source code is out there and I look forward to using that, actually. I can't see why this couldn't be done, as long as you've got the data and the logic implemented. It's definitely possible, but there's nothing in the system today that does that-but it sounds like a good feature.

Q. What format is the raw data in? Does a text file work?

A. Frank Purcell: Earlier we've mentioned Google Transit Feed Spec (GTFS) format, which is a text-based format - comma-separated or comma-delimited format, which is something that you can preview, edit, and create in Excel. It's more than just one file, though. It's about six or seven different files, some small, some big, but yes, that is a text file format. The demo that I just gave was using a database. It wasn't using the Google Feed Spec format. The TimeTablePublisher (TTPUB) can read the GTFS. At TriMet, we found it a little easier to manage our data in a database, so there's a custom binding for our database. Somebody else has created a binding for an XML format that they have created. So you're not limited to only the GTFS, as long as you create your own data loader. But if you have GTFS data, the default TTPUB loader will read your data with no extra programming needed.

NOTE: the GTFS loader in TTPUB currently lacks the capability to load multiple sets of data based on more than one service date. The one limitation, TTPUB functionality-wise, is that the ‘Compare‘ tool (e.g., compare two service dates) does not work with GTFS data. That said, it's not a big stretch to improve the TTPUB loader code to support schedule data with multiple dates.

Q. Can the raw data be in Excel?

A. Frank Purcell: GTFS is a comma-delimited format, which is natively supported by Excel.

back to top

Q. Can Google Transit Feed files come from an Excel table if the Google Transit Feed file is the raw data?

A. Frank Purcell: The GTFS file would be the raw data.

David Sullivan: You could produce that data, as Frank said, in Excel. Excel has an option to output the data as comma-delimited, so you can use Excel to build your Google Transit Feed file data and then output it into the comma-delimited text file that the Feed Spec actually needs.

Q. Have you tried installing and running this from a Java-based CMS like Alfresco?

A. Frank Purcell: No. (I have looked at Alfresco a couple of times now, and would be more than interested to look further-if you want to talk further, send a note to the timetablepublisher.com group).

Q. If you are using the TTPUB, do you no longer use Quark Express? Do you no longer need it?

A. Frank Purcell: No, you still need a publishing tool to do print layout. The benefit of TTPUB is that the graphic designer using a publishing tool does not have to touch the scheduling data. It's provided in a format that gets imported into the publishing tool-we don't use Quark Express; we use Adobe InDesign, whereby TTPUB outputs XML for InDesign; an output from TTPUB could be built for Quark to do the same thing.

Again, the benefit is that scheduling data is no longer something that is edited or touched by a designer. Before using TTPUB, a lot of manual edits were made to the data in order to format it and fill in or take out pieces of data. They would go into the table and they might cut a table out, move a table around, change dates, scary things like that where they were touching the data a lot. They were touching data that they probably shouldn't. In the new world of TTPUB, they're still using that publishing tool as a layout tool, but what they don't do is touch that schedule data anymore. They don't even touch the table; they basically import the data into their publishing tool, where the scheduling data fills in a blank table in the design, and go from there. Also, the designer might import multiple routes, depending on what stop it is, or at least multiple service keys and directions for laying out one of the pages that they want to print. The data itself, the tables themselves, just come through that XML feed into InDesign.

David Sullivan: They would still use the tool to do some of the custom layout. But again, all the variable data, the timetables that change constantly, that's going to come in and be untouched. You could build an XML template with the tool and ultimately get to the point where you wouldn't need Quark Express if you spent the time and energy to do that. I think you could get there. I think for us, we will be using Quark Express for a while longer. But as Frank said, we're taking the editing of the actual timetable data itself out of the hands of the layout people.

Q. Does TTPUB use stops that are associated with scheduled timepoints by default?

A. Frank Purcell: Yes it does, as long as you've got a way to define that. For example, inside of the GTFS, if you're looking at that format, there are two things. One, there's a proposed field that says "this is a timepoint/this isn't a timepoint." It's really a Boolean 01 on the timepoint and not a timepoint. Or, if you don't provide a time for a certain stop in one of the text files, that's not considered a timepoint, whereas if it is, it is a timepoint. As long as you define your data in some way that TTPUB can recognize, it will put up a timepoint. TTPUB then gives the ability to editing timepoints from a given timetable and refining that data further.

back to top

Q. Will these presentations be made available for download after today's webinar?

A. Charlene Wilder: They will. You will be able to download them.

Q. If you did real time dispatching from Trapeze, could someone click on a route and see where it was and how late it was running from here?

A. Bibiana McHugh: TTPUB is really for working with scheduled information. I think the questioner is talking about using real-time information and comparing that with the schedule to calculate if it's running late or not. That's probably the function of your dispatch or real-time information system.

Q. Is the GTFS robust enough to support other downstream applications like AVL or APCs? Is it a viable substitute for TCIP? Is it transit industry data exchange standard?

A. Bibiana McHugh: The GTFS is basically designed for transit agencies to share information with each other and with the public. It has everything that's required to do itinerary trip planning. It's in a very lightweight easy-to-read file format that really meets the requirements for what it's intended for.

Q. Does printed PDF output for riders have a telephone number for TriMet and URL on the printout? Can header/footer be added to each page of output?

A.  Frank Purcell: Yes, we've got a header and footer in all of our TTPUB-generated PDF timetables. There is a capability to change those headers and footers in the tool. (That said, there's room for a lot of improvement with PDF - the templates are nowhere near as flexible currently compared to PDF).

Q. Can the templates be modified to change style features like font or color?

A.  Frank Purcell: Yes, all of the HTML aspects can be changed. A lot of the HTML that you see on the TriMet page is formatted by CSS. That said, the template is just a text file that can be edited any way you want. In the template, there are certain commands to import the timetable(s) and other pertinent route data.

back to top

Q. Would this be hard for a user if they don't know Java?

A.  Frank Purcell: Ah, I get to use my joke. It's so easy, even a manager can use it (my manager's laughing right now). I can't say it's simple to use, but a few people that had no Java experience got TTPUB up and running and they were successfully. Whether that's an indicator of how easy or hard it is, I'm not sure, but I know other people who weren't all that comfortable with Java did get it running.

Bibiana McHugh: If you want to customize it or make modifications to the code, you do need Java ‘development‘ experience.

Q. Is updating and taking advantage of new codes simply a process of downloading and replacing the TTPUB.war file in the existing directory?

A.  Frank Purcell: Yes, just replace the war file (and maybe restart your app server). Only if you wanted to go out on your own and create new code (or add custom patches to the current code) would you have to compile your code into a war file.

Q. Can one do a time buffer based on earlier-versus-later? If the new trips are even one minute earlier, that justifies a new schedule, but three minutes is probably fine, if the new scheduled is layered.

A.  Frank Purcell: Currently the Compare Tool in TTPUB takes in one ‘time buffer‘ parameter, which defaults to three minutes. That 3-minute value can be changed easily in a web form. If you needed to have two time buffers (eg: 1 minute earlier, 3 minutes later), with today's application you would run two separate compare reports. That said, the functionality to support two time buffers rather than one would be really simple to add, so I'll put it on the todo list.

Q. What agencies are using the TTPUB currently? Of those, which are publishing it to an iPhone?

A. Bibiana McHugh: I used that iPhone just as an example of one of the enhancements that can be made, so somebody could go out there and develop a template so that this information could be viewed on an iPhone.

Frank Purcell: I've used TriMet's web timetables (generated from TTPUB) on the iPhone, and they work fine. I would eventually like to add more dynamic timetable outputs to TTPUB…things like personalized timetables and small format (iPhone / any phone) outputs.

What agencies are currently using TTPUB? TriMet is using it now for its web and print timetables. Hampton Roads, as you've heard, have a pilot project going on right now. And a few other agencies have looked at the application and gotten proof-of-concepts running, but nothing that I could point you to as an example.

Bibiana McHugh: One of my first slides has a list of agencies that have experimented with TTPUB.

Q. You mentioned needing the direction_id field in GTFS's trips.txt file. Does the TTPUB easily handle unidirectional routes?

A.  Frank Purcell: Yes. If you don't specify a direction field, all the trips will be classified as being inbound by default. As long as all the trips for a route are one direction, you would get a unidirectional timetable. TTPUB also supports building unidirectional timetables out of multi-directional data - for example, I've seen unidirectional loop routes where the scheduling system will do half of the route inbound, half of the route outbound (why the route is coded this way, I'm not sure, but it happens). There's a configuration in TTPUB to merge these two directions into that unidirectional timetable route. A good example of this is TriMet's Washington Park Shuttle (http://www.trimet.org/schedule/h/t1073_0.htm). Here, the scheduling data has an inbound path from Washington Park MAX to Lewis & Clark, and a corresponding outbound path from Lewis & Clark back to the MAX stop. In TTPUB, we simply configure a unidirectional loop with all the stops (from both inbound and outbound data), and add a configuration that tells TTPUB to pull all the data and lay out the timetable as a unidirectional loop.

Q. How do you configure the template? Is it HTML, InDesign, or another software program?

A.  Frank Purcell: The templates are simple text files, which look a lot like HTML, XML, text, or whatever text format you'd like to create-PDF output is handled a bit differently. Within these templates are specialized commands that instruct the templating engine (something called FreeMarker, a fairly well used template library for the Java world) to pull together the data needed for a given timetable. Given this schedule data, the Freemarker template can then iterate through the rows and columns, names, etc., and construct whatever output you'd like. It's fairly straight forward, and a lot of template macros have been built to different layouts (e.g., xml, html, text).

Q. You mentioned Linux. What experiences do you have operating the TTPUB from other operating systems, both on the server and on the desktop?

A.  Frank Purcell: The version of TTPUB I used for the demo is running on a Linux server here at TriMet (Cent OS). I do all my development on either a Mac or a PC. I've run it on those three operating systems. So I've send the same code-base on all 3 major OS's. There is a requirement of Java 1.5 support, which all three OS's do support (I'm using features from Java 1.5). I haven't seen any problems regarding operating system choice. That said, I only use Mac and PC for development, and Linux for production.

back to top

Q. Can you run late trip reports along with other reports of the program?

A.  Frank Purcell: No. We wouldn't have that data; we'd only have the schedule data. We wouldn't have any historical stuff from the vehicles to build such reports.

Q. Can footnotes be added to an entire trip versus at individual timepoints, for example, school trips, day, exceptions, etc.?

A.  Frank Purcell: Yes. I showed the footnote that was for a specific stop just to say the bus does continue after this stop on these certain trips. There are other configurations that will simply tag the trip (selecting the left-most timepoint to place the footnote). Like everything else, if there is something that TTPUB can't do today, it could always be built and added. The different configurations in TTPUB come from the requirements that we have at TriMet on footnoting conditions-things like express trips and the like are all driven by events in the scheduling data. If other events or requirements exist, it's a simple matter of programming to handle that…

Q. Is the software compatible with Mac?

A.  Frank Purcell: Yes. You can download Java 1.5 JDK and Tomcat 1.6 for the Mac. I do that. I run TTPUB on the Mac all the time, as a lot of the code was developed on the Mac.

Q. Is there Open Source software that creates the GTFS system?

A. Bibiana McHugh: No, there isn't at this time.

Q. Could you verify the runs after they're completed?

A.  Frank Purcell: There are ways-there is the compare tool to look at what the old schedule and the new schedule look like and for us printing out, we can print out all of the timetables or a subset of them in one PDF file, if you wanted to do a visual compare.

Q. Do you provide technical support and training manuals?

A. Bibiana McHugh: I gave a link in my presentation, http://groups.google.com/group/ttpub-user. The group is TTPUB/user. That's where you would go to really seek support from the development community for this application: training manuals, most everything you need to know to get started. The link to the developer notes and more information about the developer notes are also in the first presentation, www.TimeTablePublisher.org.

Frank Purcell: As part of the Open Source spirit of this project, contributions of any kind are welcome. If you don't write code to contribute, maybe you could contribute formal documentation or even answers to the discussion forum.

Q. How many users can use this program at the same time?

A.  Frank Purcell: That's a good question. The Configure Tools is a web app, so multiple users could be theoretically using it on their browsers at the same time. Where you might run into trouble if you're trying to add a timepoint to a route and your neighbor is doing just the opposite to the same route. Because the data source behind the web app is a single repository, you might get into a race condition where you add something, and they delete it, etc., so using the tool may require a bit of coordination between users. From a practical standpoint, I don't know how many people you want configuring your timetables. Here at TriMet, there are two or three people that use the tool to do configuration, and they seem to break up what routes they configure so they don't step on each others toes too much. As to how many, I've stress-tested the server and I didn't see that it would be a huge problem to get 20, 30, 40, or 50 simultaneous users, but that's pretty subjective to our systems here. Again, I don't think you would be having that many people doing configuration. For our web timetables, we do a batch publish on a weekly basis, so the timetable the public sees are simply static HTML / PDF files (and thus, the public is not hitting the TTPUB tool). Eventually we'll be adding to TTPUB to do personalized timetables and adding more dynamism to our timetables, so we'll be running TTPUB as a live web app. I couldn't really say how many people could be using that TBD webapp, but as a requirement it will need a reasonable response time (i.e., less than one second per request) with 50 simultaneous user requests.

Q. Can you get passenger counts from this program?

A.  Frank Purcell: No, that would involve data that is not really scheduling data. That said, if you had the data available, and you could integrate the data someway, somehow, I'm sure you could do something interesting there. But TTPUB in its current configuration is really just a publishing tool; I don't see it as a backend analysis tool of how well the trips went and everything else. But then again, that's just my opinion. The code's available and it can be changed and updated a 1000 different ways…I'd love to see this creation do things I'd never dreamed of, so who knows.

back to top

Q. Will the questions and answers be available?

A.  Charlene Wilder: They do complete a set of the questions and answers f or the T3 webinars. You can also get a copy of the presentation from today. That will not be a problem.

Q. If I have an Excel table with times and stops, and output that into a comma-delimited, I can use them as a GTFS file?

A.  Frank Purcell: The GTFS format has a specific format that your data needs to follow. Please see: http://code.google.com/transit/spec/transit_feed_specification.html. If you're in a comma-delimited format, it might not be that hard, depending on what you're data looks like, to go the next step, and make it GTFS compliant.

Q. Can you also have a printed date to identify the newest output for the replacement purposes?

A.  Frank Purcell: TTPUB outputs an ’Effective Date’ of the service on the current web and print templates. The HTML output also includes a build date, and TriMet's print schedules (using InDesign) have a similar build date added to them. But those dates are output only and not something retained in TTPUB.

There was talk of storing a ‘street‘ date in the TTPUB database, so that TTPUB would become a management system telling you when the material on the street was last updated. But that functionality never became a requirement for us, so we don't have either that or the build/print date in the TTPUB system.

Q. Can this program help to figure out better transfers between routes?

A.  Bibiana McHugh: I think Frank mentioned that it's not really an analysis tool. It's a publication tool.

 Frank Purcell: Yes. It just doesn't have the logic to that. But again, anything is possible.

Q. Can you write billing reports with this program?

A.  Bibiana McHugh: Again, no, that's outside the scope.

Q. Can you run a demo of the program?

 Frank Purcell: Yes. If you go to TimeTablePublisher.org, there is link to a running version called ”Demo Application.” It's got some real old data from Amtrak. BTW, this demo is running on a free hosted service and the up time of that server is pretty questionable.

Q. Are any future efforts underway (like the TTPUB Open Source from FTA) to easily create the GTFS? When might that be available for small transit systems?

A.  Bibiana McHugh: That project is currently on hold. I'm not sure where it's going to be going. I could get back to you at a later time. We're actually going to be discussing that this weekend. Hopefully, I'll have a good answer to that next week.

Charlene Wilder: The FTA has been having conversations with Google and part of the Google transit groups. We are hoping in the future to have this system with our small transit systems, this Open Source system.

Q. Can this be used for deviated routes, and can real time deviations that are updated when they come in be available to see?

A. Frank Purcell: Again, it's more of a publishing tool at or when the schedule is ready to go. Bringing other data into the system is not something TTPUB was designed to handle.

Q. Does your system have exception trips, for example, Friday only? How well does this translate to GTFS into the TTPUB? I would also like to request additional default service type of any knowledgeable code contributors, for example, holiday/other schedule.

A. David Sullivan: Our system doesn't have what I would call exception trips. We have routes that maybe only run on Friday or only run on Saturday, but when that route runs, all of its trips run. So we don't have exception trips, so I can't really speak to how well they translate through GTFS. We really don't have those.

Frank Purcell: Yes, we can handle Friday-only trips, assuming that a footnote is the best way to handle distinguishing these trips from the other trips in a timetable. Basically, you can footnote trips/stop times based on a variety of schedule events (in the case of Friday only, by service key). This timetable is a good (or bad, if you consider more than one footnote not good) example of such footnoting: http://trimet.org/schedules/new/w/t1100_0.htm#footnotes

Please see a follow-up discussion on Exception Trips at http://groups.google.com/group/ttpub-user/browse_thread/thread/9a34612a48a951f2.

Q. We have a series of school day only, school holiday only, Tuesday and Thursday only routes that are stored as exceptions in HASTUS. GTFS does not have a field that covers these entries, which would be a problem if we were to use GTFS as input to the TimeTablePublisher.

A. Frank Purcell: See the answer above. Also regarding GTFS - there is a proposal for ’trip_short_name’ http://groups.google.com/group/gtfs-changes/browse_thread/thread/ab34be2731aa2288, which could be used to mark an Exception trip. In the TriMet GTFS data, we're adding ’Express’ and —Limited’ into the trip_short_name field, and updating TTPUB to read that field for configuring footnotes to such trips.

Q. I think I now have a total of 11 GTFS.txt files. Should the extra two files be suppressed before running the TimeTablePublisher?

A. Frank Purcell: Basically, it doesn't read them.

Bibiana McHugh: It only reads the files that it needs

Q. We currently use RouteMatch. Is this program just for scheduling and route planning?

A. Frank Purcell: This program is for building web and print timetables for the public, once you've done the scheduling and route planning and you've got that data ready to go. It's more for creating things for public consumption. It's for creating public timetables from that schedule data.

Q. Does the compare tool work if timepoints have been added or removed? How different does it have to be before it throws up its hands and says it's all different?

A. Frank Purcell: The Compare tool shows both what times have changed as well as what timepoints have changed. At some point, the data can get too sparse (eg: if you just have one timepoint in a schedule - which isn't a schedule at all) that the tool will basically punt. But as long as the two routes share two or more stops, you should get some useful comparison back.

NOTE: Again, the Compare tool does not work with GTFS data loads as of yet (the Compare Tool that was demoed was using data from a database), since the TTPUB loader is not able to load distinguish multiple schedules sets based on date. Make noise on the discussion group if this is a critical show-stopper to using TTPUB, and I'll see what the community and I can do.

back to top