June 30th, 2009

GTFS feeds: you can get there from here (and a free lunch)

As any Mainer will tell you, you can't get there from here. And as any Heinlein fan will tell you, you there ain't no such thing as a free lunch.

Much to the consternation of both, SEPTA has taken a bold step into the 21st century by not only signing on to Google Transit, but also releasing freely available GTFS (Google Transit Feed Specification) feeds of their transit data.

Free feeds for getting there from here... get it?

Anyway, as a fella who has dabbled in creating transit-related software in the past, I'm thrilled that doing so in the Philadelphia area won't be an exercise in screen-scraping for too much longer, even though it worked out well for my own septime.org site as well as iSepta (neither of which are affiliated with SEPTA).

iSepta in particular should now be able to quickly move to the official feeds and add subway and trolley stops, since those are included in the new GTFS feeds.

SEPTA is also releasing a somewhat iSepta-like service of their own, to be called Next to Arrive. That service will include realtime information about the actual locations of trains, which is a step up from simply knowing where they are supposed to be.

SEPTA has not yet released feeds for bus routes, so septime will continue to screen-scrape for the time being. Although I expect I'll soon get around to using the official GTFS feeds for regional rail, subway and trolley information. That way I'll be ready to rock when the bus feeds arrive.

When SEPTA finally releases feeds for bus routes, it should be practical to plan a trip via Google Transit that involves both sides of the Ben Franklin Bridge... much like the lives of so many PhilaJerseyDelphians. Hoo rah.

Everyone who is encouraged by this news should take a moment to thank SEPTA for doing the right thing via their official comment form. I am assured that these are read by real live human beings, so be nice. And ask politely how soon bus data can be added to Google Transit and the public feeds.

Google Transit is a game-changing social tool because it makes transit accessible to people who don't have time to make a second job of mastering the transit system in their new city. And it makes the planning of spontaneous trips to unfamiliar destinations practical even for those of us who do know the system well enough for our usual trips. This is especially important in a city like Philadelphia with six different modes of transit (*), counting SEPTA services alone.

GTFS feeds, incidentally, couldn't be simpler. You might be expecting some sort of whizzy high-concept XML. Nope, it's just a collection of CSV files any Excel power-user would know what to do with. There's a .csv for the stops, a .csv for the routes, and so on and so forth. And they include GPS coordinates! Whee.

This is all very handsome stuff, but it makes me nostalgic for an analog transit trip planner I once encountered in a subway system many moons ago: every station had a little lightbulb next to its name. You pressed "from" and "to" buttons located next to the two stations you wished to travel between. Boom, the shortest path between them lit up.

The principle behind it? As simple as they come: electricity takes the path of least resistance.

Of course, that trip planner wouldn't tell you what time to expect the train, or whether that particular train was even running on Tuesdays after 10pm. For that, I'd suggest Google Transit. Or if all else fails... a printed schedule [shudder].

(*) Regional rail, subway, trolley, El, bus and light rail.