Adding GPS location to raw photos

I have a lot of travel photos taken on my DSLR that are missing the GPS location.  Having the location is handy for friends and family to see exactly where the photos were taken from.  Over time your own memory fades too.

Most of my photos are in raw format (Canon CR2), and I can use Picasa to set the GPS location, but only after the photos have been processed and saved as JPG (or TIFF etc).  If I add the location to the raw image, then it saves the location to metadata that only Picasa recognises.

If I go back and reprocess the raw photo, then the new JPG will have lost the location information.  What I needed was software that could add the location to the raw photo.

I looked around for alternate software, and did try a few things.  Usually they didn't work on raw files, or were just clunky to use.  Many applications are also designed for taking coordinates from GPS loggers - which I don't have.

Furthermore, I don't want to have to type in GPS coordinates directly, instead I should just be able search a map and let the software figure out the GPS coordinates.  This is specifically how the Picasa Places panel works.

I've now settled on using Exiftool, and Picasa to set the location.  It's still more clunky than it should be, but I'm able to use the software that I already had installed.

Note Picasa is discontinued by Google, but I'm sure you can still download it.  Additionally there are some quirks, and workarounds documented.

Raw GPS location setting workflow

My workflow is to use Picasa to set the location on the processed JPG file.  Then use Exiftool to copy the GPS exif data to the raw file.  I've used it with Canon CR2, but it should work with Nikon NEF, or DNG, or any other files supported by Exiftool.

This procedure requires that you have first performed conversion of the raw file to a JPG (or TIFF etc).  Find and select the processed file in Picasa.

Open the Places panel if not already open.

If you need more space you can also make the panel larger.

Set the location of the image, by searching and then moving the position marker to the correct location.  You can use the Map or Satellite view to help you pinpoint the right spot.

The GPS coordinates will now be saved to the Exif (Exchangeable image file format) properties in the JPG file.  You can view the GPS Latitude/Longitude details in Picasa under the Properties panel.

At this point the JPG file has the GPS location, but the original raw file does not.

Open a Command Prompt shell.  Use the exiftool command to copy the GPS location from the JPG file to the raw file.  For example:
exiftool -TagsFromFile IMG_6022.JPG -gps:all IMG_6022.CR2
    1 image files updated
Note, by default  exiftool  will backup the original file - just in case something goes wrong.  In this case the original file is named IMG_6022.CR2_original.  Once you're satisfied the new raw file is alright, you may remove the backup.

After Picasa refreshes the thumbnails you'll see that the GPS location is also set on the raw file.

In addition, any other software (including Capture One Pro shown here) will recognise the GPS location information in the raw file Exif.

If you upload the image to Google Photos then it will show the location as a place name, GPS coordinates, and a preview map.  Clicking on the map will take you to Google Maps.

I hope you find that workflow helpful.

Batch GPS location processing

If you have a lot of files, the above process to set the GPS location on raw files can be a tedious process.

However, if you have a Unix background, you can use tools available in Cygwin to perform batch processing.

For example, this command assumes that every JPG file in the current directory has a corresponding CR2 file to transfer the GPS coordinates to.
$ ls *.JPG | cut -d. -f 1 | xargs -i sh -c "exiftool -TagsFromFile '{}'.JPG -gps:all '{}'.CR2"
TIP: Remember that Cygwin is case sensitive.

Comments

Popular posts from this blog

Resolving FOSCAM connection dropouts

Building an automatic chicken door opener

TVersity media serving to the Astone AP-300