Tuesday, October 31, 2006

Geotagging with map.search.ch

Flickr (the well-known photo sharing Web site) introduced geotagging on August 28, 2006, but I didn't get interested in that feature until a few weeks ago, mainly because I don't own a GPS (yet). However, using a GPS and a tool such as RoboGEO is not the only way to geotag your photos. With Flickr, you can simply drag and drop a photo to a map, and position it more or less precisely. The problem, for me at least, is that Flickr uses Yahoo! Maps (quite logical, since Yahoo! acquired Flickr in 2005), which is by far not the best mapping service for Switzerland (check out my Flickr map and you'll see why). Fortunately, somebody created a very handy bookmarklet which allows to geotag your photos on Flickr using Google Maps, which is already better for Switzerland than Yahoo! Maps. Even better yet is map.search.ch, certainly the most detailed mapping service for Switzerland.

As far as I know and contrary to Google Maps and Yahoo! Maps, map.search.ch does not offer an API to develop third-party applications. So how exactly do you geotag your photos using that service? The first step is to use the following URL:


This will force map.search.ch to use Swiss coordinates (at least for its reference point, located in Bern). By default, you will be in "interactive mode", so simply use the mouse to navigate across Switzerland and to zoom in and out. When you have found the position you were looking for, simply switch to "static mode". You will get a URL like this:


The Swiss coordinates of the point at the center of the image are given by:

Y = 600000 + (x * 1024 / z) / 1.25
X = 200000 - (y * 1024 / z) / 1.25

You can convert the Swiss coordinates above to WGS84 coordinates using, for example, the formulas given by swisstopo:

Y' = (Y - 600000) / 1000000
X' = (X - 200000) / 1000000

L' = 2.6779094
   + 4.728982 * Y'
   + 0.791484 * Y' * X'
   + 0.1306 * Y' * X'^2
   - 0.0436 * Y'^3
P' = 16.9023892
   + 3.238272 * X'
   - 0.270978 * Y'^2
   - 0.002528 * X'^2
   - 0.0447 * Y'^2 * X'
   - 0.0140 * X'^3

L = L' * 100 / 36
P = P' * 100 / 36

Then, simply add the following tags to your photo:

geo:lon=xx.xxxxxx (value of L)
geo:lat=xx.xxxxxx (value of P)

Finally, use the Flickr Map GeoCoding Bookmarklet I mentioned above, for example, to geotag your photo using the coordinates given in the tags. And, voilà, your photo is geotagged!

To make the whole process easier, I'm currently using a simple utility that monitors the clipboard and automatically converts the map.search.ch URLs directly into Flickr tags. Of course, this is not a satisfying solution, but it's still better than nothing!


Ole Seidel said...


this is a great description - very helpful and very detailed! How did you figure out the coordinate system issues? What a challenge!

If you happen to have GPS tracks in either GPS or NMEA format, also take a look at Fodysseus as a slick alternative to Robogeo: very intuitive automated geotagging of photographs! http://www.fodysseus.com

Olivier Bruchez said...

> How did you figure out the coordinate system issues?

I just took a few reference points, for which I already had Swiss coordinates and played a little with the map.search.ch interface. It was not very difficult, actually.

> take a look at Fodysseus as a slick alternative to Robogeo

Ok. Thanks for the recommendation! It looks like there is only a German version, though.

Ole said...

The software is available in English as well; we're currently working on the English version of the web site.

Just download it and give it a try.


Simon said...
This comment has been removed by the author.
Simon said...

Thanks for this useful information!

You have a link with the anchor "the formulas given by swisstopo", pointing to http://www.swisstopo.ch/pub/down/basics/geo/system/ch1903_wgs84_en.pdf

Someone at Swisstopo apparently decided that this URL didn't look professional enough (much too short!). I had a hard time finding a suitable document, but I think I found it under http://www.swisstopo.admin.ch/internet/swisstopo/en/home/topics/survey/sys/refsys/switzerland.parsysrelated1.37696.downloadList.61029.DownloadFile.tmp/swissprojectionen.pdf.

This is our tax dollars/francs at work, *sigh*

Olivier Bruchez said...

Thanks, Simon! I've updated the link.