Copying geo data from one image to another.
2009-06-30
In my last post I created a panorama by stitching a number of photographs together with DoubleTake. One problem with creating synthetic images is they lack the geo data I embed in the rest of the photographs from my GPS’ track log. I figured the always excellent exiftool could accomplish copying the data so it would be visible in Lightroom but I wasn’t entirely sure how. After some trial-and-error this worked:
$ exiftool -tagsfromfile Z09023676.dng -@ geotags.txt marmotpass.tiff
where geotags.txt is a list of all the tags to copy from the source image Z09023676.dng to the destination image marmotpass.tiff:
-EXIF:DateTimeOriginal -EXIF:CreateDate -EXIF:ModifyDate -EXIF:TimeZoneOffset -XMP:DateTimeOriginal -XMP:DateTimeDigitized -XMP:ModifyDate -EXIF:GPSSatellites -EXIF:GPSLatitude -EXIF:GPSLongitude -EXIF:GPSLatitudeRef -EXIF:GPSLongitudeRef -EXIF:GPSMapDatum -EXIF:GPSDateStamp -EXIF:GPSTimeStamp -EXIF:GPSAltitude -EXIF:GPSAltitudeRef -XMP:GPSLatitude -XMP:GPSLongitude -XMP:GPSDateTime -XMP:GPSAltitude -XMP:GPSAltitudeRef -XMP:CountryCode -XMP:Country -XMP:State -XMP:City -XMP:Location -IPTC:Country-PrimaryLocationCode -IPTC:Country-PrimaryLocationName -IPTC:Province-State -IPTC:City
If you forgot to turn on the GPS for some portion of the shoot (hmmm) but happened to shoot from the same location at another time, remove the date and time related fields and apply the same approach.
You might find it easier to omit the “-@ geotags” bit and just copy over all the data, then adding explicit deletes for the items you don’t want (such as, perhaps, exposure information).
I think for the synthetic photos using explicit deletes make sense. I actually started looking at the GPS related fields because I had some photos from the Marmot Pass hike which didn’t fit the track log (I forgot to turn on the GPS) but were taken from the same spot as other photos for which I did have accurate data.
Do any of your plugins support copying metadata from a source to a destination image? The meta data wrangler appears to be a post-filtering plugin and the geo-encoding plugin doesn’t look like it supports it either. I downloaded the SDK today, perhaps I’ll give it a try.
This is along the lines of Jeffrey’s comment, but not quite to the point of copying everything. You could make use of the ExifTool groups to copy a number of tags at once. For instance, you could use “-GPS:all” instead of listing the EXIF GPS tags individually — it is a bit easier, and ensures that you get all the EXIF GPS tags.