Google Maps + GPS Tracks Experiments

I've been having some fun!

Speedmap picture

It all began with...

We've been doing a fair amount of hiking these past few years (in Taiwan, Switzerland, Canada, and (soon) in Hawaii). we see some pretty cool stuff, but the pictures sometimes don't tell the whole story. So I've been looking for a solution to that problem.

Then, I started mountain biking in the Don Valley trail near where I live. The trails are amazing, but it's a real maze -- there are so many! Google as much as I want, I couldn't find a map of the network of trails. I thought it'd be fun to map the trails, perhaps using a GPS unit. So I purchased a GPS unit at the Mountain Equipment Co-op.

And then, Google published a Javascript API for their mapping site. I haven't done too much Javascript in the past, so I thought this would be a good occasion to learn it. I started toying around with their API on Friday night; by Sunday night I could plot the data from my GPS unit onto google maps.

The culmination (so far) of all that work has been a site where people can plot their own gps data and share the resulting maps with others. I'm still working on new features, including addressing the issue mentioned in the first paragraph above -- showing pictures where they were taken on a map.

I don't know if anyone but me will actually read this :), but just in case there is, this page is meant to make it easier to navigate through some of the experiments that I've done.

Aenean viverra. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Aliquam lacus. Mauris magna eros, semper a, tempor et, rutrum et, tortor.

The (very) early samples

Like I said above, I started looking at the Google maps API on a Friday night, after having come back early (around 10pm) from our weekly Friday night LAN party at Vizible. I think it took me a bit of time to get my head wrapped around the fact that the google maps API is all client side -- no need to install any server-side pages (asp or jsp) or that kind of stuff. That made my life a lot easier

By 12:30am that same night I had my first sample. I don't think I'll get a nobel prize for that one -- it just plotted a single line on a map of Palo Alto. The second sample was ever so slightly more interesting: it plotted two actual GPS trackpoints on a map (of Toronto). The two points were the beginning and end of a track I recorded when biking from the gym to my workplace. It's always a relief when integrating two different data sources that way -- and in this instance it was particularly exciting, as it worked on the first try. The third sample used the same two data points, but also added markers at the end and beginning. A small step for Jimmy, a huge step for... for... people from Moonbeam?

Sample 4 seems like a Google sample that I copied. I'm sure it seemed useful at the time, though it seems rather trivial now that I look back. Sample 5 was even more disappointing. Looking at the time of the files, it was 1:00am when I worked on these 2 samples, I guess I was getting pretty tired. You will be forgiven if you don't look at them.

Sample 6 marks the beginning of a new day -- Saturday morning! It's also a lot more interesting than the previous 2 samples: it shows the entire track (breadcrumbs) of biking from work to home. At this point all the data is hard-coded into the page, but it's a start anyway. Sample 7 adds a "Route following" feature which moves the viewpoint along the whole track. Combined with the "hybrid" view (which shows satellite imagery enhanced with highlighted roads and road names) and a close up view, that looks pretty impressive (try it!), if I may say so myself. I should probably end on a high note and not mention sample 8 at all.

During that same evening, I added Google ads and a bit of a description to my "Biking home from work" page. I also recorded a new data set when going to drop off my better half at the Taste of the Danforth, in the car. This was more of a test of the GPS unit than a test of the google maps stuff. I was testing if the gps unit would work equally well when in my pocket compared to sitting on the dashboard of the car. The answer? I get much better results when the unit is horizontal, and has a clear view of the sky. My GPS unit is a Garmin Gecko 301, by the way. I got it at the Mountain Equipment Co-op for 270$.

The plot thickens -- other bike rides

Remember that I said that one of the reasons why I bought the GPS unit in the first place was to map the mountain bike trails of the Don Valley network. One thing that I really wasn't sure about was how good the GPS unit was going to perform in the forest. So I got myself a bike mount for the ol' GPS unit, and went out in the easiest trail to try it out. I recorded on the way in and on the way out. I also added a boatload of explanations on the pages themselves. I don't know why I like describing what I do so much.

Shortly after, I took part in the Tour For Kids. The full tour is a 4-day event, but I was only able to do the week-ender version on Saturday and Sunday (you need to click on the 'parse' button -- yes, you can paste in your own data). What's neat about this map is that I not only mapped the position of the breadcrumbs, but I also color-coded the line based on how fast I was going (originally enough, I call this a speedmap).

The latest thing that I did was to generate a URL for maps based on user-entered data. The idea there is to let people who don't have any web server space publish maps with their own gps data. The innovation lies in how I generate URL's for up to 1200 points or so (the limit being Internet Explorer's maximum URL length of 2000 characters or so, and Firefox' inability to handle more than 800 points or so).