Monday, April 30, 2012

On the Metro Transition to GPS

A user asks:

When will OneBusAway be based on GPS tracking of each Metro bus, so that it will be more accurate and work (at least for locating buses) even when buses have to be re-routed?

Would that it were that simple. We are told that the transition to GPS, already well over half complete, will be over by early Autumn, but it may deliver less than you thought it promised.

Here's the basic idea of how OneBusAway works. There are two parts:

1. About four times a year, OBA gets a schedule from each of the agencies, including Metro. The schedule says "here's where and when all the buses are going to stop from now until the end of the service interval several months from now." For example, it might say- for one of the almost 30,000 KCM trips the schedule describes- that there's going to be a route 16 trip every weekday starting at 7:18 AM- and here's where and when it's going to stop- and this is the ID it will be labeled with.

2. Every day, all day, we get real-time reports of trips- tens of thousands of them. What we get in each report isn't so much "here's where the bus is" but rather "here's how this trip is performing against the scheduled trip." Something like "trip X is running Y seconds off schedule."  Ahead of, behind, or spot on. That's called "schedule deviation."

So- we know where the agency said it would be, and we know what the "schedule deviation" is. We might also know where the bus is, but it's all but irrelevant.

A user is standing on the street at a stop, and she asks OBA: tell me about any trips that are headed to this stop. OBA looks at the schedule and looks at the real-time reports and computes: here are the trips that are supposed to be there soonish, and here's what we know about how those trips are performing. Add it all up, and it's able to give you the display you seen on a smart phone: this trip looks to be five minutes late, we've seen no recent realtime data for this other trip but it's scheduled to be here in eight minutes so we'll show you that, and here are five other trips with this or that status.

How does GPS make any of this better from the old bus-location system? Only this way: the old system delivered less frequent reports of less accurate location data. Therefore, real-time reporting could compute less accurate schedule deviation.

GPS is not a silver bullet. It does make some new stuff possible, such as detecting when a bus is off route, but there is a bunch of design and engineering between where we are and presenting that to a rider in a useful way.  In particular, we are some ways from being able to present the rider with the actual location of a bus that is off-route.


Joel said...


I would add a couple points to this. First, it's not as if the bus location data is hidden and unavailable. Real-time bus locations are publicly available from the same UW-ITS data stream that OBA has used for years, but through other ports. When Brian developed OBA, he chose to tap off of the UW-ITS 'prediction' port, which is the final step of a sequence of processes. Presumably, this was so that he would not have to develop prediction algorithms on his own. For the OBA application, that made sense. But live streams of the actual lat/long reported locations of the buses are also available from ports that are further up the stream.

As Metro has been switching over to GPS, the GPS bus reports have been being added into the legacy (AVL) real-time stream, so it now contains both the old AVL-derived reports, and the newer GPS ones. So those GPS bus locations can be utilized by anyone.

As you explained, though, having the actual bus location does not readily allow OBA (or MyBus/Tracker) to make accurate departure predictions if a bus is off-route. One could imagine constructing a program to try to deal with this issue, but it's not easy to predict arrival at a goal point if we don't know the route the bus will take to get there.

However, a program such as Busview, which displays bus locations on a map, ought to be able to accurately show an off-route bus IF the bus is equipped with GPS. Theoretically, that should be the case right now for GPS-equipped buses. The primary Busview display doesn't really depend on the scheduled route information at all Many years ago, UW-ITS did successful demonstration projects of Busview (and MyBus) that included GPS data feeds.

All of that being said, though, you are certainly right that switching to GPS does not automatically solve all problems. In fact, my sense is that there are a lot of problems with the implementation of the GPS-based system from INIT that Metro decided to use. The reported locations from the GPS-equipped buses are often much at variance with the scheduled routes. There are clearly many bugs to work out of the system.

Metro has gone through this before. The old AVL system, as I understand it, had a lot of shortcomings as it was originally delivered. It was only through much hard, persistent work by folks at Metro (like Darrel Riley) that it finally became an amazingly dependable resource. It looks like we are now facing that kind of break-in period once again with the new system.


Joel said...

After further thought, I realized I erred in a fundamental part of what I wrote above. Although the UW-ITS stream does include lat/long, this info is calculated at the UW from knowing where the bus is on its route. The actual GPS lat/long is not being fed to UW-ITS from Metro--we're getting simulated AVL data that mimics the legacy AVL format, which does not include the location fields. So, in fact, the way this is currently running, Busview would NOT properly display the location of an off-route bus. The lat/long in the stream will only be correct if the bus is on its scheduled route.

Sorry about that--that's what I get for writing first and thinking later!

weekilter said...

If GPS is supposed to "help" it sure doesn't sound like it does which brings up why bother to equip buses with GPS if it's not going to ultimately let Metro and the general public know just where a particular bus is along its route. If it's of no real help why fit buses with GPS other than relieving operators from announcing stops.

Aaron said...

I have been catching up on the OBA challenges, and just can't wrap my head around any of this stuff. Scott, help me, please.

Regarding AVL, what is the initial source of this data? I'm assuming schedule deviation is operator-reported, because that's the only way I can imagine receiving schedule deviation data without knowing the actual locations of the coaches.

"We might also know where the bus is, but it's all but irrelevant."

It's so far from irrelevant as to be mind-boggling, unless data is completely untrustworthy, in which it shouldn't be part of the story at all.

I can imagine a system that works extremely well, and all that is required is pinpoint GPS accuracy, and a decent idea of the time it takes for busses to travel between stops. The former may be the issue, the latter is something that metro has been estimating since they released their very first schedule, ever, and from personal experience, works well.

So what's the deal here? It's not hard to use the above information to say "Bus arrived here at X time, it's supposed to be here at Y time, looks like it's off Z minutes at this stop." No averages needed, stop-by-stop estimates of schedule deviation for each coach.

The only hiccups I can think of that mess with this are data fidelity problems (GPS is lagged, wrong), and resources to handle that much computation and data collection. GPS accuracy is not really excusable, unless it too is a resource problem. Reliable systems are out there. Can Metro not afford them? The second issue sounds like a resource problem. Surely systems can handle this much info, just not Metro?

Lastly, about all the anomalous off-route business: It is enough for riders to know their bus is off-route. We shouldn't get bogged down with seriously hard prediction problems when a red "Rerouted at X location, arrival data unavailable" distributed to users will suffice.

Nicholas Barnard said...

Aaron, take a look at - It gives a good description of the old AVL system.

pauladam5991 said...

Vehicle Tracking System

Excellent post the information available here is great.