I’ve spent a couple of weeks wrestling with Nokogiri to parse a tonne of DATEX II data in to some usable format. Previously I had a mash of libxml and REXML, and the code was either ‘fast’ or ‘pretty’, but not both.
Nokogiri is good – it’s very good, in my opinion. The only trouble is, documentation and examples are a little thin on the ground, which slows everybody down. Here’s the dilemma – do I spend time writing poor documentation based on my limited understanding of part of Nokogiri, or leave it to somebody else?
Category: Transport
TfL re-release Trackernet API
Back in June, Transport for London released their Trackernet API to the public. This is about as close an insight in to how the tube network is performing as you can get without being there in person. Its enormous popularity caused their internal system to collapse, and the service was pulled. What a way to demonstrate the appetite for this data!
Ever since, there’s been frequent talk of whether the API is going to return or not. I, for one, have been particularly looking forward to the day it returns so I can get to work adding more feeds to TransportHacker. In the meantime, I’ve resurrected TubeHorus.
That day was yesterday.
I was invited to a press conference at 55 Broadway, London Underground’s headquarters, where the TfL Developer area was relaunched with additional feeds, and importantly, the Trackernet API. This time, to cope with demand, it’s been placed on the Microsoft Azure platform, although Microsoft’s representative was keen to point out that it’s not just for .NET applications.
Despite having to rush out of the press conference to catch a train out of town, I’ve had a few hours playing with the API, and it differs little from the original service. The biggest changes I can see are:
- URL change – it’s on a different server and the URLs are RESTified
- There’s little server-side filtering of the data, so you may end up pulling more than you actually need
- Data freshness – the data is only pushed out to the cloud every 30 seconds. I know at least one person who was deeply unhappy about this
- You need to register – free – to get the URL for the service, but it’s not locked down with an API key
TfL really haven’t had an easy task to get here, and I salute their efforts. TrackerNet was a system designed to take multiple sources of data from the trackside and other operational systems, and present them internally in a coherent manner, including to drive other internal systems. It was never envisaged that the general public would have access to it, and so architectural decisions were probably made regarding its sizing that precluded making its data available en-masse.
So, TfL have set the standard. If they can build a platform to disseminate their real-time information sensibly, why can’t the likes of National Rail Enquiries? Hopefully NRE will see the benefits of making their real-time data (and whilst we’re at it, static data too) available without onerous contracts and agreements. Heck, NRE already have a scaleable platform for their Live Departure Boards service that can handle train information for the whole country – why are they concerned about scaling?
On a less political note, we’ve also been promised access to the Journey Planner API within the next few months, and there were some murmurs about real-time bus information, but nothing concrete.
Real-time Tube Tracking
I have a lot of respect for the folks at the Greater London Assembly, especially those who worked to get the Train Prediction API exposed and available.
Many people have seen Matthew Somerville‘s Live Map of Underground Trains which was whipped up in a frighteningly short time.
I’m working on a Rails interface to the Train Prediction API, with an ‘advanced’ mode for those who grok the tube. It’s a little rusty, and not even beta-quality, but it’s available for you to play with if you so wish.
Here’s hoping that particular box stands up to the load 🙂
On The Buses
TfL’s Countdown system for London Buses was a leap forward several years ago. I can now walk up to a bus stop and tell – with reasonable accuracy – how long before my bus arrives.
There is one problem with this – I have to be at the bus stop!
When National Rail introduced Live Departure Boards several years ago, it was a giant leap forward for rail travellers. TfL brought in Live Departure Boards for the Underground some years later, although this is less useful.
Wouldn’t it be absolutely fantastic to have a map of a bus route with the positions of the buses on it? Colour the map in with a deeper shade where the route is more congested, and let people have a visual representation of how long it’s likely to take for their bus to arrive. Before you leave home, have a look to see where the delays are on your route in to work, and re-plan your journey if it’s going to take too long.