home

Archive for the 'Google Maps' Category

New Zealand Cycle Tour Photos and Google Map

Saturday, November 4th, 2006

I just finished uploading the photos from my cycle tour of the North Island of New Zealand. I have also finished doing the google map which shows the route and cycling stats, to have a look click the image below. Please note that Internet Explorer seems to have some issues with displaying these google maps.

Europe Cycle Tour Google Map Photos

Wednesday, September 27th, 2006

Just finished updating the Europe Cycle Tour, drawing the route that we took using GPX Draw and using a combination of the gpssave gallery2 module and also some perl scripting to position the photos in the right spots on the map.

Click here to have a look:

That was the last of the cycle tours to convert for Google Maps, it has been a challenging project, I have had to learn a couple of different API’s, programming languages and developing new modules for Gallery2 but I think it has all been worth it. I like how I can have a overview of all the tours and the cycling stats shown graphically.

Bicycle Tours Google Maps updated

Monday, September 18th, 2006

Having drawn the routes for Tasmania, Syd-to-Melb, New Zealand, South East Asia, and India, suddenly things started to get pretty slow with my Cycle Tour Google Map. Adding more photos to the corresponding albums made things even slower so I had to find a way of making the performace atleast reasonable.

The solution I found was to use album filters so that the different tours are separated and hence only the tracks and photos for the selected area are loaded. I had to go through the Google Module code to add a test for $map.Filter using Smarty, I’ve had to use so many different languages for this Google Maps project and they all start to merge and mix with each other in my head! Anyway it’s working now and the performace is reasonable.

The next problem was that many of the photos were very close together and would sit on top of each other so the user wouldn’t be able to select them unless she zoomed right in. I started changing the GPS values through the Google Module Admin form but that was very painful because it is not interactive, I needed a better way of editing the GPS of the photos. So after consulting with Termite, who is one of the main developers of the Map Module, I started programming my first Gallery2 Module.

The aim of the module is to allow you to interactively move many photo markers around the map and have their GPS data saved to database via AJAX. After a crash course through Gallery2 Module development I made a copy of a simlar module and dove right in. It took about a day to get something working and another half a day to code some helper classes for the module, it works but it is pretty scary, if you dont know what you are doing you can easily stuff up your database up and there are some security risks as well if you leave the module installed so I am not going to release the module publicly but if anyone is interested in it and want to try it at their own risk then drop me a line.

Today I added some photos for the Tasmania Cycle Tour which was my first Tour, back then I didnt have a digital camera so the photos dont have timestamps and I cann’t work out the GPS automatically, so for some of the photos I had to guess where the photo was taken. But atleast for the New Zealnad tour which I am scanning the photos in soon, I wrote the place names on the back of the photos which will make it a bit easier.

Google Map for India Photos

Sunday, September 10th, 2006


I have added the Indian Bicycle Tour to the Bicycle Tours Google Map section in the tab above. India was a challenging one to draw a track for because there is so little information for it in Google Maps. I had to go into Google Earth and put markers for the places where we stayed and then export this as a KML, and then modify my GPX Draw application to read the KML. Once that was done I went through the markers and added the cycling information.

I have also changed the campsite icons to small points because they made everything pretty crowded and the path could no longer be seen if you were zoomed out. I am thinking about having some sort of hover effect on the icons to save more space.
The tile-layer method of handling large number of points seems to be working well, I have added a lot more points now but the performance is still reasonable. Another option would be to use the new feature in Google Maps API which allows zoom specification for polyline points in order to increase performace.

Click the image above to go to the map.

Google Maps Tile Overlay

Saturday, September 9th, 2006

Having put aside the Bicycle Tours Google Maps development for a while I came back to it today because of a comment that a user made. The problem that I was having was that when I put in all the points for my tracks as polylines the data started to get quite heavy and the performance went down, this was dissappointing because I wanted to add a lot more data, so I left it for a while.
Martin left a comment a little while ago that instead of feeding polylines to the Google Map I could create custom Tile Overlays from a KML file and then display the tile overlay with much better performance for large number of points.

That’s what I have been working on today and it turned out to be easier than I thought, Mike’s page was (as always) very useful. I looked around for a way of converting my GPX files to KML but after a little while I realized it would be much easier to modify my own code for GPX DRAW to output KML than to go searching for a converter which did what I wanted it to.

Once I had KML files for my routes all that I needed to do was to modify the Maps Module to display the overlays and that was it. I also added some filters so you can centre on various Tours, so far I have “Sydney to Melbourne”, “Tasmania” and “New Zealand”. The Tasmania and New Zealand tours dont have any photos attached to them because I didnt have a digital camera back then so I will need to scan the photos in can then manually place them. But I think I will leave that for now and do the “India” tour which does have digital photos available for it, the challenge there is with the maps, we could not find very good/detailed maps of India so the routes may not be very accurate.

Click the image below to go to the map:
bike_tour_thumb.jpg

Stamp GPS to Photos

Monday, August 14th, 2006

GPX Draw is now at a useable stage, although I find that when inserting points the tolerance can be too low when zoomed out, need to make it so that the tolerance is dependent on the zoom. I have used GPX Draw to create a GPX log of my Cycle Tour from Sydney to Melbourne.

The next step was to have a program read this GPX file and a bunch of images and work out the approximate GPS for each image. I tried PhotoLinker and gpsPhoto, PhotoLinker has a nice Mac interface but it wasnt doing the weighted averaging that I needed and gpsPhoto wasn’t doing any averaging at all, so I ended up having to modify gpsPhoto which is a perl script linking to a bunch of handy libraries like ExifTool, to do what I wanted it to do.

Here is the perl script:gps_finderpl.zip

I was very pleased to see some images show up on the map finally after all the hard work. Take a look here, this is going through the Google Map Module for Gallery2 but I have modified it a bit so that it displays my track as well as the photos.

There are some problems that I ran into, biggest one being that I had to significantly drop the detail of the track down so that the google map api was displaying the data in a reasonable amount of time. I found this to be pretty disappointing but maybe a newer API will handle large number of points in GPolyline more efficiently. A fix would be to figure out what is within the view port and only feed the API the points inside and around the viewport and not the whole dataset, but that would take a fair bit of programming.

Another problem is that it can get quite crowded with the icons for all the images, the Google Map Module has some grouping features but they dont seem to work for me. Once I figure out the best way to make it all run more efficiently I will had some of the longer more interesting Cycle Tours and photos.

GPX Draw

Sunday, August 6th, 2006

After 2 weeks of wrestling with the Google Map API and Javascript I have an alpha version of GPX Draw. As mentioned in my previous posts I have been looking for a way of geocoding my travel photos but unfortunately I did not have a GPS unit with me while I was travelling but I did keep a day by day diary and the photos are all timestamped hence the idea that if I was able to draw a route of my travels with time information at each point then I will be able to estimate the location where the photo was taken by looking at the timestamp of the photo and relating it to the route information in a GPX file.

You can have a look at what I have so far by clicking on the “GPX Draw Google Map” tab in the header of this page or going to the following location:GPX Draw. The application is orientated towards cycle touring but could be modified for other purposes. This is a preliminary version, I havent done that much testing on it yet so if you find bugs then let me know.

One of the problems that wasted a lot of my time was the fact that firefox on the Mac platform does not send a keydown event when the CTRL or SHIFT buttons are pressed. Originally I wanted to have the application switch to ‘add marker’ mode if the user was holding down the SHIFT key, once the SHIFT key is released the application would go back to ‘add point’ mode. This is very nice for the user and I was very happy with the way it was working on the Linux box but when I tried it on the Mac I found that no keydown events were being generated. After much hacking around and searching for a solution on the web, I ended up having to add a set of radio buttons for switching between modes. As a user friendly measure I have added hot keys (a,z,d) for switching modes (note that the mac does generate keydown events for normal keys but not the modifier keys).

Other problems I had were with pop calendars, until I found the following The DHTML / JavaScript Calendar which is ultimate javascript calendar, plus is it free.

At this stage I am going to start drawing test routes and feeding the generated GPX into PhotoLinker along with the photos to be geocoded.

Google Maps

Saturday, July 29th, 2006

I have been diving into the Google Maps API for the last couple of days. After finding the nice Google map module for WordPress I started looking for a way of geocoding the photos that I took while travelling around the world on a bicycle.

One solution is to find the geocode for a photo by manually positioning it on a map, this would be very time consuming and tedious. The other solution is to use the time-stamp of the photograph (almost all digital camera write this into the EXIF data) and a track-log( which is a log kept by a GPS unit about where it was at what time) to calculate where the photo was take.

The good news is that most of my photos are timestamped, the bad news is that I didn’t have a GPS so I don’t have a track-log of where I went. But I did always draw on a map the route that I was taking and I kept a daily journal of the places I visited. So I did a search of the web for a program which would allow me to draw a track-log by hand then I could feed my photos and this track-log into some freely available photo-llinking program which would time-stamp the photos with the geocode.

I was amazed at the amount GPS stuff that is going on, there seems to be a revolution going on in that field, nevertheless I couldn’t find exactly what I was looking for so I decided to write my own Google Map application. It has been a steep learning curve but I am slowly getting there, here is a preliminary work-in-progress application as I start to build it up.

Photo Map

Monday, July 24th, 2006

I have been wanting to do a photo travelogue web page of the cycling tours that I have gone on for the past 5 years for a long while now. It has been on the back of my mind, bubbling away and yesterday I ran into a Gallery2 Module which makes what I wanted to do so much easier. It is based around the Google Map API and lets you enter longitude and latitude coordinates for each photo, the photo is then marked on a Google Map and clicking on it brings up a thumbnail of the image.

There is also a way of creating routes on the map, which I find very interesting I want to take all the entries from my travel diary and build up the routes that I cycled around the world. Right now I have only a couple of photos on the map and no routes but I am searching for a quick way of finding the coordinates of a town or a village for easy addition. Also it would be nice to have notes giving the date, kilometers travelled that day and the average speed.

I have added a tab called “Cycle Tours” in the header of the site or you can go to the Photo Map section from this link.