Progress on my printable timetable generator

Amtrak Unlimited Discussion Forum

Help Support Amtrak Unlimited Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

neroden

Engineer
Joined
Feb 23, 2014
Messages
9,548
Location
Ithaca, NY
As I noted elsewhere, Amtrak finally released GTFS data (though it has a few bugs), which is making it possible to generate real timetables (for the routes without the data bugs, anyway).

I still have some major things to do before considering this ready for release. Particularly getting the stations with baggage service noted properly. But also getting a decent-looking title on the page. :p But I wanted to show off my progress anyway.

A lot of what I've done on the program in the past few weeks has been under-the hood code restructuring, which doesn't give visible changes in the timetable. The internal code structure is looking more and more robust for general timetable production; very flexible for different data presentation, I think.

Anyway, this is a current California Zephyr timetable based on Amtrak's March 4 GTFS release (the most recent).
 

Attachments

  • tt_cz.pdf
    31.2 KB
I think there might be something wrong with time zones (and/or it looks like everything is currently in ET) — 5 leaves CHI at 2pm and arrives EMY at 4.10pm; but otherwise this looks great!
 
Question for the hive mind: I know all the sleeper trains have checked baggage, except #448/#449 (grrr). Including #65/66/67.

Which *non-sleeper* trains have checked baggage? This cannot be found automatically from Amtrak data.

Last printed timetable suggests that the Carolinian, Piedmont, and Palmetto, all Amtrak Cascades services, all San Joaquins, all Pacific Surfliners, and all Hiawatha Service have checked baggage. Is this correct? Am I missing any others? It's a pretty random list.

There's also some real oddities, like it cleaims that #67 (Sun-Thu) doesn't carry luggage to Richmond, Williamsburg, or Newport News but #65 (Fri-Sat) does. Is any of this correct?
 
I think there might be something wrong with time zones (and/or it looks like everything is currently in ET) — 5 leaves CHI at 2pm and arrives EMY at 4.10pm; but otherwise this looks great!
Oh, there probably is something going on with time zones. I should recheck the GTFS specification; these are all ripped straight from GTFS, so this is what Amtrak is putting out.

It is possible they are putting out all their data in Eastern time. I think that may be a GTFS thing, and I probably have to adjust for it.

But who knows what Amtrak is doing, I've already found several other bugs. :-/
 
Oh, there probably is something going on with time zones. I should recheck the GTFS specification; these are all ripped straight from GTFS, so this is what Amtrak is putting out.

It is possible they are putting out all their data in Eastern time. I think that may be a GTFS thing, and I probably have to adjust for it.

But who knows what Amtrak is doing, I've already found several other bugs. :-/

Yep, thank you, I just dug into the GTFS time zone specification more extensively -- the stop times are all internally specified in agency_timezone, and I have to convert them into stop_timezone.

Well, that'll be a fun module to add. Most of it should be straightforward but there's going to be one super irritating bit.
 
Question for the hive mind: I know all the sleeper trains have checked baggage, except #448/#449 (grrr). Including #65/66/67.

Which *non-sleeper* trains have checked baggage? This cannot be found automatically from Amtrak data.

Last printed timetable suggests that the Carolinian, Piedmont, and Palmetto, all Amtrak Cascades services, all San Joaquins, all Pacific Surfliners, and all Hiawatha Service have checked baggage. Is this correct? Am I missing any others? It's a pretty random list.

There's also some real oddities, like it cleaims that #67 (Sun-Thu) doesn't carry luggage to Richmond, Williamsburg, or Newport News but #65 (Fri-Sat) does. Is any of this correct?

The Pennsylvanian has chcked baggage. Great job on this! Remarkable progress.
 
I know you don’t care about ADA, cough cough, but you might want to find some people to test/advise on the colors and other visual accessibilities. ;)
I would be happy to have people advise on that.

I figured if I could get it working at tiny font sizes, larger font sizes would be easy. I went to some excessive effort to find an open-source font readable at very small sizes because of the need to pack information in on the printed page. Then I even tweaked the font to get the variant of "a" which is more readable at small sizes and to remove ligatures which look like mud at small sizes.

Believe it or not, Amtrak's previous published timetables actually used an even *smaller* font. I suspect that their font was commercial and required a fee, which I am of course not going to pay.

So this is currently being produced at the smallest possible readable size I could manage. If it turns out I don't need every inch of that space to produce the extremely-busy NEC and Virginia service timetables (which I might), I will boost the font size.

So, for accessibility, this is what I've done so far:
-- First and most importantly, it can all be enlarged and it should stay readable enlarged. There's no bitmaps involved. Go ahead, zoom it in!

-- Second, this PDF is actually generated from HTML and CSS. This means that style choices in the HTML version should be adjustable by the user.

-- Third, changing the font isn't that difficult (it currently does require some fiddling around with field widths, to my great annoyance), so it's readily upgradable should I find a better font.

-- Fourth, I've attemped to make the tables screen-reader-friendly according to the best advice I can find. (Which says that it's pretty hard to make something like this screen-reader friendly.) Even getting this screen-reader-friendly at the most basic level rules out a lot of types of HTML trickery.

-- As noted, color changes are similarly pretty easy to implement. I have been attempting to maintain the classic Amtrak timetable's use of background color to distinguish sleeper trains, day trains, and buses (which will also be distinguished by icons... eventually), but I'm not that picky about the colors.

In fact, I anticipate using different configurations to produce "the same" timetables for different publication outlets: "New York By Rail" will probably want different fonts & color scheme. This should be viable, though the program's not quite there yet.

I've still got a mudpile of back-end data slinging stuff to do, like marking which trains have checked baggage at which stations, and getting the station services marked (like wheelchair accessibility!), so a bunch of the CSS stuff is on the back burner.
 
Question for the hive mind: I know all the sleeper trains have checked baggage, except #448/#449 (grrr). Including #65/66/67.

Which *non-sleeper* trains have checked baggage? This cannot be found automatically from Amtrak data.

Last printed timetable suggests that the Carolinian, Piedmont, and Palmetto, all Amtrak Cascades services, all San Joaquins, all Pacific Surfliners, and all Hiawatha Service have checked baggage. Is this correct? Am I missing any others? It's a pretty random list.

There's also some real oddities, like it cleaims that #67 (Sun-Thu) doesn't carry luggage to Richmond, Williamsburg, or Newport News but #65 (Fri-Sat) does. Is any of this correct?

This looks really good! Hope the whole process works out like you're planning!

I don't remember the Hiawatha having a baggage car any of the times I rode it--and the turnaround on that train was so quick sometimes that I can't imagine them ever loading checked baggage in the time it was waiting at CUS. But maybe it did at some point in time.
 
This looks really good! Hope the whole process works out like you're planning!

I don't remember the Hiawatha having a baggage car any of the times I rode it--and the turnaround on that train was so quick sometimes that I can't imagine them ever loading checked baggage in the time it was waiting at CUS. But maybe it did at some point in time.

I think one of the two ends has a cabbage car which is a mix of checked baggage car and control unit for the engine. At least that's what I recall when I was researching it back around 2012. It very well might have changed between then and now!
 
This looks really good! Hope the whole process works out like you're planning!

I don't remember the Hiawatha having a baggage car any of the times I rode it--and the turnaround on that train was so quick sometimes that I can't imagine them ever loading checked baggage in the time it was waiting at CUS. But maybe it did at some point in time.
The old Hiawatha timetable only showed checked baggage for Milwaukee and Chicago. No other stations. I do wonder if this is still true.
 
The old Hiawatha timetable only showed checked baggage for Milwaukee and Chicago. No other stations. I do wonder if this is still true.
According to the current information gleaned from the reservation system, painstakingly I might add, since there appears to be no simple way bypassing the well known British Museum Algorithm :) that is still true. Baggage Service only at CHI and MKE.
 
Last edited:
The days are a little confusing. You always show the days in sequence. Chicago leaves on a Tuesday, Omaha Wednesday, Salt Lake City then goes to Monday instead of Thurs
 
That's the way it shows in the 2020 Amtrak version. https://juckins.net/amtrak_timetables/archive/timetables_California_Zephyr_20201005.pdf
They probably are showing the days of the week in the order that we normally look at the days of a week (Mon through Sunday).
The Amtrak timetable is also bad then. I would logically look down the column of days based on starting day. The way it is currently done is only good for someone trying to see what days they can leave from a specific station. It is not good for someone continuing a trip. We should be improving the current timetable. Mileage is still needed but maybe it is not available.
 
The Amtrak timetable is also bad then. I would logically look down the column of days based on starting day. The way it is currently done is only good for someone trying to see what days they can leave from a specific station. It is not good for someone continuing a trip. We should be improving the current timetable. Mileage is still needed but maybe it is not available.
I suspect your average rider is more interested in what days the train leaves their starting point and isn't paying attention to the stop before theirs.
If I'm looking at the stops between my starting point and end point, I'm only interested in the times, usually just to see if it will be dark or light when I pass through the area.
 
I suspect your average rider is more interested in what days the train leaves their starting point and isn't paying attention to the stop before theirs.
If I'm looking at the stops between my starting point and end point, I'm only interested in the times, usually just to see if it will be dark or light when I pass through the area.
That's reasonable. It would be nice to be able to generate a personal schedule with actual dates.
 
The days are a little confusing. You always show the days in sequence. Chicago leaves on a Tuesday, Omaha Wednesday, Salt Lake City then goes to Monday instead of Thurs

I know; it's substantially trickier to do it the other way. I would have to carry around extra data to figure out "what the starting days were". The algorithm primarily fills one cell at a time, in no particular order, so it doesn't know what the previous cell's day listings were. (I know this isn't obvious from the results. The GTFS database-like format makes this the easiest way to do it, and it's allowed for a very elegant architecture, but there are a few things which become harder.)

I suspect your average rider is more interested in what days the train leaves their starting point and isn't paying attention to the stop before theirs.

That was my thinking. When I'm checking for connections and timing in order to actuall plan out a trip, that's what I'm doing: going "does it arrive on day X" and "does it depart on day X".

(For instance, when the convention in Indianapolis starts Thursday evening and ends Monday morning, what is the closest arrival I can schedule without missing any of the convention, and what is the earliest departure I can schedule without missing any of the convention.)

I am quite capable of telling that the train leaving on Sunday arrives on Tuesday two days later in order to plan the connection to the next train, even if the Tuesday isn't lined up with the Sunday visually.

I realize it would be nicer if I could get the days to "rotate" in a column, but given that most of the trains should be daily again soon, I really don't want to put too much effort into less-than-daily information.

(Hmmm. Thinking about it there may be a way to do it without too much intervention. No promises though. I have to get the damn baggage markers done; I think that's much more important.)
 
Last edited:
Mileage is still needed but maybe it is not available.

There is no source for actual "railroad mileage" (mileposts) in the GTFS files.

Technically you could compute a rough distance between stations from the GTFS shapefiles, but I haven't even looked into doing so. I never used the mileage in the timetables myself, so it's a very low priority for me. (Generally if I were thinking about distances, I would be looking at a map first... that's another matter, releasing better Amtrak maps, but out of scope for me at the moment.)
 
Back
Top