Easy Geotagging with ExifTool

Need to quickly geotag a bunch of photos taken at a specific location? ExifTool is your friend. Using this powerful command-line tool, you can geotag multiple photos with a single command. Before you proceed, make sure that ExifTool is installed on your machine. To install ExifTool on Ubuntu, execute the sudo apt-get install libimage-exiftool-perl command. Next, you have to obtain the longitude and latitude of the desired geographical location, and feed the coordinates to ExifTool as follows:

exiftool -GPSLongitudeRef=E -GPSLongitude=139.7513889 -GPSLatitudeRef=N -GPSLatitude=35.685 *.jpg

This command will geotag all JPEG images in the current directory. If you are running Windows, download the latest version of the ExifTool executable and rename it as in the example below:

exiftool (-GPSLongitudeRef=E -GPSLongitude=139.7513889 -GPSLatitudeRef=N -GPSLatitude=35.685).exe

Drag and drop the photos you want to geotag onto the executable and ExifTools will do the rest. Besides GPSLongitudeRef, GPSLongitude, GPSLatitudeRef, and GPSLatitude, ExifTools supports a number of other tags. Check the GPS Tags page for further info.

Tech writer covering Linux and open source software

Tagged with: , , ,
Posted in Open Source, Photography, Software
7 comments on “Easy Geotagging with ExifTool
  1. januutreurle says:

    This description is a very meagre description of ExifTools capabilities. These could easily fill a four page article.

    I use ExifTool quite often to geotag a bunch of pictures from a logfile of my gps logger. It easily handles hundreds of pictures and logs containing many thousands of fixes.

  2. geek65535 says:

    While I think exiftool is great, geotagging is better handled by software that can either correlate a track from a GPS device (usually in GPX format) or allow a user to find a spot on a map. Fortunately, there’s a great piece of software that can do this. Not only is it free, but as it’s java-based, you don’t even have to install it. Just go to: http://geotag.sourceforge.net/ and click on the “run it now” link on the left. Cross-platform, too. (I’m not associated with the ‘geotag’ project. I just use/enjoy it.)

    • januutreurle says:

      @geek65535 “correlate a track from a GPS device” with time in pictures is one of the functions Exiftool does quite fast. I use f.e.
      > exiftool -m -geotag [trackname].gpx -geosync=+15 “[folder with photo’s]”

      • geek65535 says:

        Good to know, thanks. I hadn’t run across that function. I will stick with ‘geotag’, though (even though I’m a command-line guy at heart) because the interface really helps, especially if you’ve got issues with the camera time not matching the GPX track (or there not being a GPX track).

        Personally, I’m just hoping/waiting for the day when all cameras have built-in GPS (US), Galileo (EU), Compass (China), and Glonass (Russia).

  3. januutreurle says:

    quote – especially if you’ve got issues with the camera time not matching the GPX track – unquote.
    That’s exactly where the -geosync is for.

    (quote – even though I’m a command-line guy at heart – unquote. Guessed that already from the word integer part of your name ;) )

    • geek65535 says:

      Yeah, I saw the -geosync option. I’m pretty sure I’ll use exiftool for geotagging at some point. (I use it for other things now, like adding the initial copyright info to my images as part of my ingest process.)

      What I meant by geotag helping with the time being off is that if you don’t realize the time is off (as I don’t sometimes when I forget to snap a pic of the GPS before I start shooting), then you get images at the beginning or end of the run that don’t get geotagged, and it’s easy to see in the GUI.

      Trust me, I’m not knocking exiftool. I think it’s an amazing program.

  4. Thank you very much for your example of how to use this command. I found more than 300 non-geotagged photos taken before GPS cameras came into use. They were already listed in a map file, so their locations were known. All I had to do was extract the coordinates to the attribute table with field calculator in Quantum GIS and save it as a .csv file in the directory with the photos.
    Then I wrote a small script which read the coordinates and photo names from the .csv file one row at a time and saved them as variables. I added the exiftool command with the variables used in place of the coordinates and the wildcard for the photo name. With a few more finishing touches, I set up a loop and viola! Over 300 photos geotagged successfully in only a few minutes! That saved me a lot of work, and no GPX track was required. :)

Comments are closed.

Recipes for automated and streamlined photographic workflow on Linux

Curve presets for digiKam and the GIMP

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: