Posts Tagged ‘transit’

Reconstructing transit usage from Presto records

Public transit in Toronto area can now be paid with Presto fare cards. As part of an online registration functionality, one can access their card activity history. I was curious to what extent it would be possible to use that data to automatically reconstruct trips I’ve taken. I was most interested in distance travelled and mode (bus, subway, streetcar, train).

Useful data available is:

  1. Time of tap
  2. Transit agency operating the vehicle or station tapped
  3. Location of the tap – with some limitations, sometimes inaccurate
  4. Amount paid

The data isn’t quite perfect for my purposes. There are a few problems:

  1. Taps are not required everywhere
    1. Most trips do not require tapping out when leaving, including when leaving the subway. In many cases, a 2-stop trip can look the same as a 12-stop trip.
    2. Particularly in City of Toronto there are many in-station transfers for transfers between subway and buses that do not require taps
  2. The location of the tap is sometimes wrong (perhaps due to malfunctioning GPS)
  3. Sometimes a location is recorded specifically (“Square One GO Bus Terminal”), sometimes generically (“Zone 20”)
  4. Taps can take a few hours or days to arrive in online history (particularly the bus card readers seem to be uploaded nightly), though it does come in eventually
  5. There is a “discount” field which doesn’t actually show discounts as publicized in official fare schedules and is, as far as I can tell, useless

(Presto online interface also has a “Transit Usage Report” view, but it seems to only include fare payments, and none of the free transfers. As I understand it, it’s used for claiming tax credits.)

The exports are straightforward enough: it’s a simple CSV file. It is in reverse chronological order (latest taps first), but that’s easy to reverse.

Given the data, here’s what’s possible:

  1. Calculating the minimum number of trips taken, by only counting trips that had a fare charged
  2. Calculating the minimum number of trips involving the subway, by only counting entering subways with no in-station bus or streetcar transfers (these are mostly downtown Toronto)
  3. Estimating, with fairly high probability, a least one of modes of transport (bus, streetcar, subway, train) involved in a trip
  4. Estimating, with better than chance probability but not close to perfect, the number of logical “trips” taken and some of the modes involved

Here are some less obvious samples of actual data, commented to note what I was actually doing. I switched the order to earlier taps first for easier reading.


Build This Idea: Ultimate Transit App

Welcome to “Build This Idea”, where I write about stuff I want to exist but can’t make myself. Treat it like an idea store; if you like something, take it; if you make it, let me know — I’ll be delighted to check it out.

Vancouver: You’re on the Skytrain heading to Main and Broadway from Metrotown. Is it faster to transfer to the 99 at Broadway, or the 3 at Main St? That depends on how the buses are running right now and an app could tell you.

London: You’re at Hoxton looking to go to Hampstead Heath. Do you wait for a Highbury train or walk from Dalston Junction to Kingsland? An app could tell you.

An app that would be very, very focused. Very city specific, very local. With actual entrance locations, accessibility information, real transfers and connections, measured walking times, and real-time data.

Transit-specific apps with real-time info aren’t new, of course. Citymapper is doing this but they’re not doing it as well as it could be done. Same with Transit. They both appear to be focusing on getting as many cities as possible, which is fair enough and makes sense from a VC funding/making money point of view. But it doesn’t necessarily make sense from a user experience point of view.

To elaborate, here’s some things current solutions aren’t very good at:

Google: As far as I can tell, real-time info isn’t used in transit directions in the flagship Google Maps Android app. Where supported (and that’s very far from everywhere with data available), real-time info is on the station/stop card, but there’s no way to get to the card from the directions screen. If you’re deciding if you should take the 3, better hope it runs on published schedule! #itdoesnt (Google Maps has a number of hilarious other problems. The platforms for Toronto subway are shown as separate stations at the same location, and you can only tap into one of the “stations.” Particularly fun at transfer stations where you can only get schedules/departures for one of the four directions. This is a GTFS source problem but Google doesn’t appear to be jumping out to fix major stuff like that.)

Citymapper started out as a London app, but still has somewhat frustrating incompleteness in London information. They correctly have the Euston transfer from Northern line Bank branch southbound to Victoria line southbound as a 1 minute walk: it is as cross-platform as the Tube gets. But they list the Green Park transfer from Victoria to Piccadilly line, in practice a 4 minute walk even if you know which train carriage to be on, as 2 minutes. Time to get to platform is also estimated at best, and seems to be on the quick side. Special cases like Camden Town station being exit only on Sunday afternoons — published on the Tube maps — aren’t handled.

Citymapper piggybacks on Google Maps and individual entrances to the stations aren’t mapped; in large stations with several entrances this can be a couple minutes’ walk. Optimal routes through the stations; optimal carriages. This all saves maybe a couple of minutes, but then so do apps for ordering tacos.

It is possible to do better. I would like it if someone did better. Will there be a business of it? I don’t know. I hope so.

There is, of course, a risk of Google starting to do this in 2016. But it might be a risk worth taking. The other competitors aren’t perfect, and Google hasn’t bothered yet. Real-time transit information has been in Google Maps since mid-2011 but Google has yet to make it anywhere close to universal, let alone really use it smartly; it feels like they’re too busy with self-driving cars and internet blimps. In any case, being really good, about really specific things, that really impact people daily, is a nice niche to be in.

And, of course, ideologically it will be a good thing if more than one company has good software in this market (so long as standards eventually converge). There is a GTFS-realtime but so far it hasn’t seen pick-up at anywhere near the scale of the original GTFS. Will it eventually steamroll the market like GTFS once did? And even if it does, will building up the technology be a waste?