Google-Maps
And today has seen a little more work Underground:
- The shared tracks algorithm has been rewritten (God knows what I was thinking of when I wrote it).
- Track size is now based on the zoom level.
- Bezier curves have been implemented (with a little help).
- Central tracks are now reasonably smooth.
Still doesn't do anything useful mind...
I've finally pulled finger today and geo-coded the entire London Underground. Yes, my long abandoned Tube on Google Maps has had a makeover. Not only is it now full screen, with the ability to toggle stations and lines on and off, but all [underground] lines are now present, along with the 275 stations.
There are still a few outstanding jobs, mind:
- The track overlay algorithm is dodgy.
- Areas with shared tracks look rubbish once you zoom out.
- The tracks haven't been smoothed - they jump from station to station instead of curving nicely.
- It doesn't actually do much of use...
Still, maybe these will get fixed next time I feel the urge. And there's still the DLR and London Overground to add if I'm feeling really keen!
Just to prove that I can accomplish more work on the Tube than the tits at Metronet, I've finally update my Tube on Google Maps application.
We now have the complete Misery/Northern Line, mostly smoothed (apart from the Charing Cross branch), the dusty dusty Drain aka Waterloo & City Line, the rather jagged (for the moment) Circle Line and the central part of the District Line.
There have also been code improvements: it now uses the Google Maps API V2, interchange stations are differentiated from stopping stations, lines on the same path do not completely overlap (in progress, still a bit dodgy around Paddington) and it works again (an API change had broken a dodgy bit of code, whoops).
Still a little way away from being useful, but getting there. Slowly.
Yes, Flickr now has geo-tagging (i.e. the ability to specify where your photos were taken by way of a map). The problem is that this worldwide in the same way the World Series is - yes, US only. It's using Yahoo Maps, and unfortunately out of the way places like Paris and London are represented by a couple of squiggly lines and some low resolution satellite imagery. Hence geo-tagging the back streets of London becomes an exercise in frustration.
This is in marked contrast to the excellent maps of both via Google Maps. Yahoo please take note: this is a fine example of integrating with the worst service just for corporate warm-and-fuzzies. Mind, given Google still haven't managed a mobile version for the UK and Apple still think 'English' is equal to 'American' it's hardly a bias particular to Yahoo.
Suddenly my bandwidth usage has gone crazy. So my Tube map and Calendar Control are down for the present... (e.g. until June - sorry).
Further investigation seems to place the blame on some search bots operating at inktomisearch.com. They've eaten *huge* amounts of bandwidth - do these people not realise that others pay for bandwidth? Tits, the lot of them.
Today started out stunning - sun, no wind, not a cloud in the sky - but as normal this state of affairs declined to persist and faded away into a mediocre cloudy afternoon. I hence decided to spend my Saturday afternoon pursuing that rather superb collection of museums out in South Kensington (V & A, Natural History and, my choice of the day, the Science Museum).
Unfortunately everyone with children within the M25 had decided on the same course of action. The tube station was chaos, the stairs packed with prams and the tickets barriers stuffed with tourists deciding at the very last moment to hand out tickets to everyone. And the museums superb exhibits were unfortunately punctuated by a horde or children (or more likely one or two very loud individuals). At one point a parent could be heard encouraging one to shout for their missing sibling. Honestly, if they must leave the interactive galleries is it so hard to at least stop their children playing hide and seek among the models of maritime steam engines?
But nevertheless the museum is excellent. And not only excellent, but free. And it's not the only one, which is one of the better highlights of living in London.
Coming home I was struck with the optimisation bug. And hence my tube map will now only draw the stations currently in the view. However, the lines draw for the entire map. Why? Because otherwise it gets rather hard to follow a line when scrolling the map.
The one vexation of the Google Maps API is that they require a key for access, which they issue for a particular hostname. This means I need different keys for development and deployment and I keep forgetting to swap them before uploading. Sigh. The terrible tribulations of life. On the other hand, if that's the worst thing then I don't have much to complain about.
Well, I've been outclassed. The Tube Journey Planner not only maps the tube very nicely but integrates real-time problem information as well.
Technically, they are cheating a bit. They're using edited background images to show the tube lines. Hence it's not easy to modify (not a problem in London as our chances of getting another tube line are non-existant) but the line lines are smooth and look really good. And the redraw is nice and fast. Downside - the map stops at the end of the tube lines - the world outside has vanished (and a good thing, too).
Neat toy though, very nicely done. And it does set quite a high benchmark.
And here's a second release of the tube-on-Google-Maps application.
What's new?
- We can now specify points between stations to let the line curve.
- The Bank branch is shown.
- The code is a lot cleaner and now uses objects.
Still coming:
- Status information - It looks like I'd need to screen-scrape the ETA and travel news pages on LU, so may need a PHP page in to scrape and convert to XML.
- Status area - currently thinking a right side panel to hold station information/problems.
- Curve algorithm - because entering them manually sucks.
- Missing lines - along with an algorithm to ensure lines between the same stations don't overlap.
Stay tuned!
Just to prove I'm not just piss and wind, I've started writing a tube-on-Google-Maps application.
This is just a first draft - we only have the Charing Cross branch of the Northern line (as I live at Oval). All the data is supplied via an XML file and so adding extra lines and so on is just a case of suffering entering each point. First, however, I'd like to work on functionality with minimal clutter.
So, my todo list:
- Make the lines curve - I'm not too worried about accuracy, but the dead straight lines look silly. The Google Maps API seems to avoid curves so I'll need to fake it. Hence I need to add support for intermediate points between stations.
- Add station information. There's a wonderful Dashboard widget called Tubetrack which display real-time information for stations. This data would look great on the station pop-ups.
- Add status information. This is easy to obtain and it would be nice to see what's working (e.g. not the Northern line).
- Re-factor the code to eliminate multiple maps and use objects. And move it to an external JS file.
- Add the missing lines. For when I'm really, really bored.
By the time that's all done it might actually be useful. Maybe... but it'll be fun. The API is really easy to use and made this a complete breeze. Kudos to the designers.
While I keep thinking it'd be neat to overlay the Tube on Google Maps some people have gone ahead and done similar things: A geographically accurate tube map, a geographically accurate map on satellite map and a start at mixing them with Google Maps (station to station only, but still rather neat).
Also, a map of future transport projects (and more information on them). Spiffing, if needed ten years ago...