Saturday, January 9, 2010

Changes to data from King County Metro

One of the other big changes in the last week is the move to a new data source for King County Metro. Traditionally, schedule data has only been available as a raw database dump from KCM's scheduling system. In the transit hacking world, the Google Transit Feed Spec (GTFS) is pretty much the ad-hoc standard for exchanging schedule data. GTFS is the format internally used by OneBusAway and I wrote a converter for KCM's custom data to get it into GTFS.

KCM, hoping to encourage developers to work with their data, held a developer workshop last October where they announced the availability of their own GTFS feed. While the feed is a big improvement, it still has a number of issues (holiday scheduling errors, route label errors) that I got a chance to work on over the winter break.

The upshot is that OneBusAway is now using KCM's GTFS feed with some custom modifications. The modifications include better stop names, fixes for interlined routes downtown and at UW, and finally correct holiday scheduling information.

Let me repeat that: we've got a fix for the interlined routes issue. This has been a major problem with KCM's data in OneBusAway since day one. To quickly summarize, a number of downtown Seattle routes enter downtown as one route and leave as another. The tricky part is where they make the switch. Most routes in practice switch right before they enter downtown. Unfortunately, KCM's schedule database often showed the switch happening well into downtown. The upshot is that many people would check OneBusAway for a particular route and not see it because it was mislabeled in the system. For example, as a Ballard resident, I'd often check for a route 15 or 18 from Pioneer Square, but see route 21 and 56 instead. This affected a ton of routes:

1 => 36, 10 => 12, 11 => 125, 12 => 10, 124 => 26, 124 => 28, 125 => 11, 13 => 2, 13 => 3, 13 => 4, 131 => 24, 132 => 19, 132 => 24, 15 => 21, 15 => 22, 15 => 56, 15 => 57, 17 => 27, 18 => 21, 18 => 22, 18 => 56, 18 => 57, 19 => 132, 2 => 13, 2 => 3, 21 => 15, 21 => 18, 22 => 15, 22 => 18, 222 => 233, 23 => 28, 233 => 222, 236 => 238, 24 => 131, 24 => 132, 249 => 921, 26 => 124, 27 => 17, 28 => 23, 3 => 13, 3 => 4, 33 => 39, 39 => 33, 4 => 13, 4 => 3, 43 => 44, 49 => 7, 5 => 54, 5 => 55, 54 => 5, 55 => 5, 56 => 15, 56 => 18, 65 => 67, 68 => 31, 7 => 49, 921 => 249

Through some additional data made available by KCM and through data collected on our own, we've written a tool to fix KCM's schedule data to fix the interlined routes issue.

That said, even though the feed comes with a ton of fixes, there are also some issues with the data. For example, I've gotten a couple of reports of bad data for the 255 headed to Kinsgate. If you notice anything, definitely let us know.

5 comments:

Michael Hoffman said...

This is good news. Thanks!

Peter Abrahamsen said...

Thanks, I just noticed this last week for the 26 Northbound leaving 4th and Jackson. Will check it again.

eldan said...

Hooray! This has been a niggling issue which looked like it must be a PITA to fix. Thanks for doing it.

lindes said...

Awesome! I've long-since learned to live with this, mostly, but I know it's been a point of confusion for many. As another frequent 15/18 passenger from pioneer square, I can say that this is very much a welcome change.

I do have one thought on how you might improve it even further:

I think it would be great if you also listed the final destination name, and/or the route number that a particular bus will be turning into. A couple examples:

Coming from Interbay (stop 13800), the 15 and 18 buses change into, I think (it's rare that I care much) a total of 3(?) different routes (21, 22, 56, maybe others?). Most of the time, I'm destined for downtown, or Pioneer Square, or SODO at the furthest, so it doesn't much matter to me. Other times, I need to get specifically a 21, to get to a particular spot in West Seattle. It would be great to know which of the busses would get me there.

Other times, I'm at Queen Anne and Mercer (Stop 2672), looking to get to 12th and Pine. Most 2s and 13s stay/become a 2 and get me there, but some 13s end downtown. On the front of the bus, I can tell a 13 that goes to "Madrona Park" (will be a 2) from one that ends "Downtown Seattle". In One Bus Away, though, they always say Downtown Seattle, which doesn't help me when I'm on a 15/18, trying to decide whether to get off at QA&Mercer or stay on board until 1st & Union and get a 12.

(This would also be a great time to have that multi-stop with filters thing... Ideally, in that specific use case, I could filter to just the one actual bus I'm on, and any 2 or 13 at stop 2672 or 12 at stop 60, all on the same screen all at once, so I can decide what my chances for a transfer at each stop might be.)

Anyway, thank you!

lindes said...

P.S. Showing which route a bus *was* can also be useful, for example when meeting up downtown with a friend who's coming in on a bus that changes numbers -- someone who got on a 15 might now be on a 56, and it would be easier to watch for their bus if that information was shown.

:-)