geo:lat & geo:lon saved as separate keywords

Started by jarhtmd, October 19, 2013, 02:47:44 PM

Previous topic - Next topic

jarhtmd

I know very little about geotagging images, as this post will probably quickly reveal. A couple of years ago I bought an inexpensive logger & began using GeoSetter to tag my JPG images. For various reasons, mostly because of my geotagging ignorance, that didn't seem to fit well into my workflow. I wasn't completely satisfied & eventually abandoned the effort. The payoff just didn't justify the effort. But that's water under the bridge . . .

Fast forward to my latest venture . . . attempting to use Lightroom4 to catalogue my JPG images (including old images).  I'm also new to Lightroom.

GeoSetter had added keywords like geo:lat=-12.12465583; geo:lon=-77.02875674; geotagged. Lightroom sees that as 3 separate keywords. I assume GeoSetter also stored those coordinates elsewhere in the metadata. I don't see the usefulness of geo:lat or geo:lon, separately & alone as keywords. To me, as individual keywords, they seem to just be clutter & confusing.

Am I totally misunderstanding something? Can/should I remove those keywords w/o losing the GPS coordinates?

Phil Harvey

I don't see much value in keeping these keywords if the corresponding EXIF GPS tags have been written.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

jarhtmd

Thanks, Phil, for your prompt reply.

I have discovered that some of my images (per Photoshop CS6) have only the geo:lat & geo:lon as keywords, without the coordinates in the metadata.  Some of those images were sent to Flickr, which seems to have translated the those keywords into GPS coordinates.  The images are shown on Flickr's map & the coordinates are in Flickr's metadata. 

I "think" I remember discovering that situation a year or 2 ago. During that time I wasn't geotagging most images by any method, but for some I simply got the approximate coordinates (from Google or wherever) & added them as keywords into the file info (via Photoshop), ignorantly thinking they were then geotagged.  Granted, that was not a smart thing to do, but that's what I did. 

The problem now is to identify those images, remove the geo:lat & geo:lon keywords and store that info as GPS coordinates.  Is there a way to do that?

Phil Harvey

This is certainly possible with ExifTool, although the command is a bit tricky so I will put the arguments in a separate argfile.  With this argfile, the command is:

exiftool -@ geo.args -r DIR

where DIR is the name of the root directory containing the images.  The argfile (also attached) looks like this:

-if
$keywords =~ /geo:lat=/ and $keywords =~ /geo:lon=/
-addtagsfromfile
@
-gpslatitude<${keywords;$_=/geo:lat=([-\d.]+)/?$1:undef}
-gpslatituderef<${keywords;$_=/geo:lat=([-\d.]+)/?$1:undef}
-gpslongitude<${keywords;$_=/geo:lon=([-\d.]+)/?$1:undef}
-gpslongituderef<${keywords;$_=/geo:lon=([-\d.]+)/?$1:undef}
-keywords-<${keywords;$_=/(geo:lat=[-\d.]+)/?$1:undef}
-keywords-<${keywords;$_=/(geo:lon=[-\d.]+)/?$1:undef}


Here I have assumed that the Keywords are stored in IPTC.  If they are in XMP, you may have to change all "keywords" to "subject" above.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).