app logo

Real-time, Location-aware transit information

How it Works


4Transit is a range of transit apps for different towns, cities, and universities which are available on the new BlackBerry Z10 smart-phone (and soon the Q10). They all provide the same core service: real-time, location aware bus, streetcar, and where available, subway and metro times from your nearest stops.

They are designed to be easy to use with the minimum of effort. Turn them on, let them find your location and transit details, and then view a constantly updated list of your local services:

Under the hood

4Transit sets out to make something quite complex look very simple.

There are three parts of any location-aware transit app:

  1. Finding the user
  2. Finding the nearest stops to the user
  3. Predicting when the next service (and later services) will arrive at those stops.

Under the hood -> Finding the user

Some apps use your phone's GPS coordinates, which is great unless you are in an area with bad satellite reception (GPS needs to see quite a few satellites to be able to determine your position. 4Transit uses BlackBerry's Location Service which combines the GPS signal with information from the cell towers you phone uses to communicate, and WiFi location information, if you have WiFi enabled. This gives us a more reliable idea of location.

Even with the help of BlackBerry's location service, it can still take your phone some time to get an accurate fix on your location. That can be really frustrating when you need to know transit information. 4transit uses a compromise between precision and speed, we accept anything within 20m accuracy as near enough to start with. It's why you may see bus stop distances jump around by a few metres from time to time as the location service bounces around a little.

Under the hood -> Finding the nearest stops to the user

First, of course, you have to decide what you mean by "nearest". You will find thsat different transit apps take a different view, and are often dependent on a third party service to tell them. 4Transit calculates the nearest stop itself, and that allows us to be more choosy in terms of the distance to your stop and haw to calculate it. We assume that you, as a transit user, are prepared to walk a little bit further to catch a subway or an express bus than you are to catch a local bus, and that lets us optimise what we present to you.

Typically in transit apps, calculating which stops are nearest to you is done away on a server in the cloud. One of the problems with that approach, is that it tends to generate quite a lot of data traffic between the phone and the server, and that uses your data allowance and reduces your battery life. Imagine how much data is used up if your phone is constantly querying where your nearest stops are. It's one of the reasons why our competitors often can't cope with you moving around; they grab the information once, and you have to restart the app everytime you need to update your location.

Because we calculate this on your phone, we don't have that problem. And we can calculate it faster than a query to the cloud (on a BlackBerry we can do this in milli-seconds). The down-side of our approach is that we need to keep the locations of the entire transit network locally on your phone. That's why the app may seem quite large for a transit app - it comes with that data. It's also why we sell apps for individual cities - to keep the amount of memory we use on your phone to a minimum.

As well as identifying your nearest stops, we also tell you approximately how far it is to each stop. This uses the BlackBerry Location Service and the geo-coordinates provides transit operators for the location of their stops. Assuming the Location Service is able to accurately identify your location (and there are reasons why it may be out by a few metres) locations of bus and street-car stops works well. However, there is an issue with Toronto's subway stations: it's not the location of the station platform that you want to know the distance to, but the the distance to the subway entrance, and there may be multiple entrances. The TTC does not currently supply a list of geo-coordinates for those entrances to app developers, and so we use a very approximate location for the stations; this is why you may be standing at the entrance to a station and still be told you are 60m away (you may weel be 60m away from the approximate location of the platforms. We are in contact with the TTC to improve on this.

Under the hood -> Predicting the next service

Many, but not all transit operators now provide real-time, live data-feeds of their buses, streetcars and subway trains. There are two "standard" ways for them to do so, and 4Transit supports both. One way provides that transit information that goes to Google Maps to third parties like us at 4Transit, the other uses the services of Next Bus Inc.

The two feeds have different ways of estimating when a bus will arrive at a stop. The one we profer at 4Transit is the Next Bus feed, which uses sophisticated predictice software that estimates where a bus will be in the next few minutes based on it's current location on a route, and its current average speeed amongst other things.

Both styles of data feed work in a similar way. Every transit vehicle in the system has a transmitter that reports details of the bus directly back to the transit operator. In thase case of cities like Toronto, Los Angeles, and London, that is thousands of buses on over 100 routes each. The transit operators then package this information up and send it for live analysis (for example by sending it to Next Bus). That number crunching allows apps like 4Transit to ask for the next services to arrive at a particular stop. It's also how the system handles the times when transit vehicles are out of contact with their base station (bad reception areas, tunnels etc.).

As an aside, the GPS coordinates that feed in to 4Transit are part of the proof of Einsten's theory of General Relativity. GPS uses satellites that are flying very fast overhead, so fast that time is differnt for them and us here on the ground. Every day for a GPS satellite is 7 microseconds shorter than for us on the ground, and because GPS calculation are all about the time it takes radio signals to reach your phone from space, the phone software has to account for that tiny difference. For more information look at this article on GPS from Ohio State University. Fascinating stuff.