Smarter Travel TransportHack
We recently took part in the “Smarter Travel hack weekend”, an event in the run up to the Smarter Travel Live conference (more on that later).
As well as helping out all the other teams with making use of TransportAPI, I had the pleasure of working with Dan Cunnington of IBM, to form a small team tackling one of the hack challenges.
Before we got started, Dan gave us a useful tour of IBM BlueMix features. We’ve been working on putting TransportAPI into this cloud services platform, and with the chance to see how these pluggable scaleable wrapped services are neatly packaged up and offered to developers, I’m excited to see this happen (coming very soon).
A hack weekend is a good opportunity to test out how applications can be brought together using the various APIs on offer. We were also working on challenges set by various transport operators. For our weekend project we looked at a challenge set by Traveline to look at bus routes (defined within TNDS, the Traveline National DataSet) and explore novel ways of determining disruption along bus routes.
TNDS is actually a beast of a dataset to work with, but TransportAPI already ingests this data and presents bus schedules and bus routes information in a far more easy to hack format, a JSON API! So that was our starting point. We called TransportAPI to populate pickers in a web interface, allowing the user to select a bus operator and then line name (number). With that we could then retrieve bus routes data from TransportAPI, including a brand new TransportAPI feature to get the exact geometry of a bus route for display on the map [Update: More recent blog post about bus route geometry]
One final offering from TransportAPI we made use of, was the TransportBuzz geolocated tweets mentioning ‘bus’, which we retrieved from bounding boxes close to the bus route.
And then came the IBM bits. First IBM Watson sentiment analysis let us classify positive / negative tweets. The aim was to make tweets into a useful indicator of bus disruption. But Dan wasn’t finished there. He was able to bring together a number of other IBM services as he describes here:
We used Transport for London’s API to obtain an image from every CCTV traffic camera in London, allowing us to train an IBM Watson Visual Recognition classifier. Live traffic images can now be classified as ‘Congested’ or ‘Not Congested’. Finally, we used appmetrics (a Node.js monitoring solution developed in IBM Runtimes) to monitor the API queries needed for bus disruption information. This provides metrics which will allow the application to be scaled from a prototype to an industry level because it is clear which functions need re-factoring because of the amount of API calls made.
The screenshot above shows the London Bus Route 91 with a bounding box query around each bus stop to identify tweets and the various traffic cameras on the route. You can see that IBM Watson has classified the traffic conditions from this particular camera as “Congested” with a confidence score of 0.62 (62%). Also you can see appmetrics has returned results in the bottom left corner regarding the amount of queries made (IBM Watson: 2, TransportAPI: 39) – in this case, too many!
This was a quick weekend hack, but Dan managed to get an amazing amount done. The image classification of CCTV cameras in particular, seemed ambitious to me, but he managed to get it working in this short timescale. Impressive! And this feature seemed particularly interesting when we demoed our work at the Smarter Travel conference. Transport industry representatives including people from TfL and the CEO of Traveline, Julie Williams, were curious to know how the image classification works, and interested in exploring how we might develop the idea further.
“it was gratifying to see that our API does enable simple rapid development of applications like this”
From a TransportAPI point of view this was a very useful exercise. As with previous hack events we’ve taken part in, we came across a few interesting friction points, and I was able to note areas where we can improve in our API. But that aside, it was gratifying to see that our API does enable simple rapid development of applications like this.
So big thanks to Dan Cunnington from IBM for working with me on this, and to Landor LINKS for hosting a fun weekend of hacking (You can read more about it one their live blog here). We’ll bring you more news of our bus routes geometry dataset, and our BlueMix integration work soon!
Identifying congestion in London using IBM Bluemix, Transport API, TfL and IBM Watson services – Write up on the bluemix developer blog
Automating bus route geometries – More about the route geometries data on used in this hack