Geotagging in Linux

You may ask why geotag images? I have some images I took on film 20 years ago and would love to know where they were taken. Often I have a rough idea but I couldn’t find my way back there if I wanted too. One image is marked ‘beside the Croydon to Georgetown Road, Queensland’. Not very helpful when you think those 2 towns are nearly 150k apart, that’s almost 95 miles for those from non metric places.

Recently I’ve been experimenting with automatically geotagging my photos, also known as GPS Co-relating. This requires having a gps track of where I have been and an application that can match that track with the appropriate photos.

First thing is to create a gps track. This can be done with a dedicated gps unit or with some other device. I chose to use my android phone because I always have it with me. To record the track requires an app. There are many available but I use ‘Open GPS Tracker‘ because it is open source, it’s free and it works. It has many options that I don’t use including real time streaming. It has the option to output .gpx files which is what the co-relating applications require.

After you have the track you need an application to read it and match it to your photos. As always there are a number of options in Linux. Digikam has this option but I couldn’t get it to work reliably so I use ‘GPS Correlator’. It is available in the repos of many Linux distros, just needs a ‘yum install gpscorrelator’ in Kororaa (and Fedora). It has more options than Digikam which is how I got it working.

One thing I should mention is that your camera and gps unit (phone in my case) must have the time settings synchronised as accurately as  possible. Doesn’t need to be to the second but as close as you can get it. As most phones handle their time settings automatically this means changing the setting on your camera. Check it before each use particularly if you live in an area with daylight saving.

In the gpscorrelator screen you can select photos to process then the gpx file you got from your gps unit. You should set the time zone your camera is set to as gps data is always in UTC. You can also set the time difference and offset. Fortunately gpscorrelator has tool tips which describe how to use these options. If you still get no match on some images try selecting the ‘Between Segments’, it compensates for any gaps in your track. Particularly useful for areas with poor gps reception like cities and wooded areas.

Gpscorrelator also has an option to remove gps data from images if you want your location to remain private. This is handy for phones and other cameras that automatically record your location. For images taken at home and at friends’ places you might prefer to keep the location private when you post them on photo sharing sites.

There are a couple of things I’ve learnt so far. First is allow some time between starting the tracker and taking your first image. Also between taking the last image and stopping the tracker. First time I tried it I stopped the tracker when I got back in the car after taking the last images. None of the images taken there would match as the last point in the track was some time before the images were taken. Today when I got it working I started the tracker when I left home and stopped it when I get back.

Second is if you are constantly moving you might need to adjust the ‘Logging Precision’ in ‘Open GPS Tracker’s settings. It defaults to normal but if you find this doesn’t give enough points try a more precise setting or set you own custom interval. Experimenting is the only way to know what works for you. Explore the settings for other options that may improve your accuracy or that you might find useful too.

If you are using the tracker for a long period, e.g. most of the day, you might need to consider battery life. So far I’ve been in the car and I can plug the phone into a charger so that isn’t a problem. But without the external power recording a track for several hours may result in a dead phone battery. This maybe a good use for an old android phone if you have one laying around, maybe you know someone who has recently updated?

Adding location tags to your images is useful now and so easy to do why not try it.

Advertisement