So over Christmas someone on the WalkLakes forum was muttering about how it would be good to be able to plan a walk along with a bus journey and we were talking about it and Beth said she'd seen on the interwebs a database of every bus stop in the UK.
So I employed some Google-fu and quickly found this: the Traveline National Dataset, which contains public transport timetables for bus, light rail, tram and ferry services in Great Britain and is released under the Open Government Licence.
I also came across the Traveline North East and Cumbria journey planner which uses the GET method for its form data which means it's easy to populate it with the fields you have. So I've now upgraded all our walks so that in the overall walk map it also shows you the nearby bus stops. Click on any stop and a little bubble popup appears identifying the stop. Here's an example screen shot for our walk 'The old Keswick Railway Line and Latrigg':
Click on the link or bus image in the popup and it opens a big popup with a frame in it which is the Traveline North East and Cumbria with the destination bus stop filled in. Sadly the form doesn't support the use of NaPTAN codes but after a couple of only partial successes I've found a way of populating the field which seems to produce fairly reliable matches with the right stop.
So that's a nice enhancement to start 2014 with and only two days from first idea to rolling it out live.
Although I love this sort of data wrangling for the technically minded the interesting part in all of this more generally was that the map, which is an iframe on a different site, has to communicate with the parent page to tell it to open the big popup. This used to be impossible but I discovered that we now have Window.postMessage and, for those browsers which don't support it well or at all, there's a little jQuery extension called jQuery postMessage which takes all the pain away.
|Tags: maps, WalkLakes||Written 03/01/14|
You can follow these posts on Twitter at @Wibblings