I have a few folders of .JPG images that I need to geo-tag. I don't have a .GPX file or anything else that will let me use my usual tools (Geosetter or Photo Mechanic) to geotag the images, but I do have a CSV file of the image filenames and their lat/longs, like this:

Date,File_name,Long,Lat
20150317,IMG_3672.JPG,-93.6325489,35.39918169
20150317,IMG_3673.JPG,-93.6322368,35.39960017
20150317,IMG_3674.JPG,-93.6322159,35.39984365
20150317,IMG_3675.JPG,-93.6322203,35.39991498

I'm on Windows 7. Obviously, I could edit the EXIF metadata manually and copy and paste each set of coordinates into the appropriate EXIF tags, but I was hoping to find a way to do it automatically. I've found the Exiftool GUI, which has the ability to copy metadata from an XMP file to the appropriate JPG, but I don't know how to get my table into a set of XMP files in order to take advantage of that. I could also create a batch script to use Exiftool from the command line, which I can probably figure out on my own in due time but to someone who doesn't deal with EXIF data regularly, the sheer number of tags, command-line arguments and options available in Exiftool is a bit daunting.

up vote 5 down vote accepted

ExifTool could do this, but the use of negative coordinates might make it a two step procedure depending upon what tags you want to use. XMP gps tags will take negative coordinates, but EXIF gps tags only accept positive numbers and need the directional reference tag to be accurate.

First off, there would have to be some changes to CSV. The first row would have to be "SourceFile,XMP:GPSLongitude,XMP:GPSLatitude". Date wouldn't be necessary, unless you need to change the date. The first column would have to be the full path to the source file. So, your csv file would have to be changed to something like

SourceFile,XMP:GPSLongitude,XMP:GPSLatitude
C:/full/path/to/IMG_3672.JPG,-93.6325489,35.39918169
C:/full/path/to/IMG_3673.JPG,-93.6322368,35.39960017
C:/full/path/to/IMG_3674.JPG,-93.6322159,35.39984365
C:/full/path/to/IMG_3675.JPG,-93.6322203,35.39991498

From there, the command would be as simple as

ExifTool -csv="/path/to/csvfile.csv" /directory/path/

That will load up the XMP gps tags. If you need the EXIF geo tags set as well, you could follow up with

ExifTool "-GPS:all<XMP-exif:all" "-GPS:GPSLongitudeRef<Composite:GPSLongitudeRef" "-GPS:GPSLatitudeRef<Composite:GPSLatitudeRef"  /directory/path/ 
  • 2
    This worked perfectly, thanks! The software I'm using apparently reads GPS data from the XMP tags so I didn't test the last step, copying the lat/longs from the XMP tags to the EXIF tags. – Dan C Apr 2 '15 at 19:44
  • the 2nd part that Dan didn't use also works perfectly. Thanks! – DaveB Aug 13 '16 at 20:25

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.