Pseudo-geeks, Google Maps, bus routes and the quest for happiness.
December 6, 2009 2:56 PM   Subscribe

How complicated is it to create a bus map on the Google Maps API?

So I saw this Google Maps mashup with NYC subways and I was wondering how hard it would be for a someone with decent geek-fu to figure out how to do it. I know that any self-respecting geek would just tuck down and tinker but I am a little stressed for time.

I am a little familiar with Javascript, PHP and MySql (more in terms of adapting then writing) and am willing to learn. I just need to know that this is not going to be a time sink. I can spend my commute throwing the actual bus routes into a KML map (is that what it is called? My knowledge in this field is limited at best.)

So what I ask of you, oh Giant Seething Meta-Brain, is what are the main steps I need to take for this? What will this require of me? How long would this take someone who is relatively proficient? What about someone with the coding skills of a drunk duck?
posted by eytanb to Computers & Internet (5 answers total) 1 user marked this as a favorite
It depends on what you're looking to accomplish. You can use the MyMaps functionality to do quite a bit, but in order to do anything meaningful, you'll be starting here with their documentation on Map Overlays. Quite a bit of code, and a bit tricky indeed.
posted by disillusioned at 4:10 PM on December 6, 2009

It would help if you clarified what you want to do, or at least provided an example of something similar you're trying to emulate. Do you just want to show the bus stops and routes overlaid on a standard map view? If so, then just draw everything in Google Earth/Maps and upload it somewhere.

On the other hand, if you want to provide up-to-date timetables and route-finding functionality, the problem gets a lot harder. I think your best bet is to integrate with the existing Google Transit system; they have a standardized file format for organizations to upload their route data. You would definitely need the blessing of the transit organization in question in order to have any chance of Google accepting your data. They'll want some assurance that the data is going to be maintained in case the schedule changes.

If that's not an option, there's no reason in principle you couldn't replicate the functionality yourself, but it would be a significant amount of work even for a skilled programmer. At a minimum it would involve something like Dijkstra's algorithm or A*, which are not too complicated in and of themselves. You'd also need efficient data structures for representing the routes and schedules, as well as a lot of UI work to generate user-friendly maps and directions.
posted by teraflop at 5:30 PM on December 6, 2009

Unfortunately, Google Transit is closed to new partners, and has been for months now.
posted by smackfu at 6:10 PM on December 6, 2009

Bing maps can be customized like Google but it appears to have better tools for customization requiring less hand coding. You might want to look into it as an alternative.
posted by JJ86 at 6:36 AM on December 7, 2009

I'd start with Google My Maps. It gives you a simple visual editor in the browser to add points and lines to a map, then you can publish it for anyone to use. Here's an example I made from a road trip. The lines were drawn as driving direction segments. You can also import any KML file as a start on My Maps, if you'd prefer to use Google Earth or something to edit the KML. (The My Maps editor can be a bit buggy.)

The My Maps UI is limited; basically you get a list of all your annotations on the left and that's that. Fine for displaying a basic bus schedule with stops, but if you want something more sophisticated you'll have to write your own code. Google publishes a very comprehensive Javascript API. It used to be complicated, but version 3 is pretty easy; you could get something simple up and going in a couple of hours if you're comfortable with Javascript. The hard part will be writing whatever UI you imagine. If the result you want looks like My Maps, then start with that.
posted by Nelson at 7:33 AM on December 7, 2009

« Older Getting Past Embarassment   |   Help me become a better professor! Newer »
This thread is closed to new comments.