please add import of location data to gps data from xmp

Started by bobfrost, February 03, 2012, 03:55:23 PM

Previous topic - Next topic

bobfrost

Please add import of location data to exif as well as the current import of gps data to exif, both from xmp sidecars.

That would make my day.

Bob Frost

BogdanH

Hi Bob,

Could be I don't understand what exactly you wish to do, but this is already possible. See here: https://exiftool.org/gui/#m_exp_imp
..menu Export/Import: Import GPS data from Log/Xmp files.

Bogdan

bobfrost

Sorry if I wasn't clear.

I've geolocated thousands of images in Lightroom, using their new geomapping and reverse geocoding module. So I've got all that location data, country, city, etc, etc, in my xmp sidecars as well as the bare gps map references.

Your program allows me to copy that gps map reference data from the xmp files to my original nefs, but doesn't copy the rest of the location data that comes from that map ref. I think there was an option to copy this stuff in an earlier version of GUI, but there doesn't appear to be one in this version. I've tried playing with ExifTool direct, but haven't found the right code yet.

So if you could add the rest of the location metadata, to the gps map reference metadata, for copying from xmp sidecar to nef, I'd be a very happy bunny. Why do I want to do this? To futureproof my nefs.

Thanks,

Bob Frost

BogdanH

Hi,

I think I know what you mean: when GPS data is copied from Xmp files, location values (Country, State, City and Location) should be copied too. Is that correct?
In this case we talk about four additional values to copy. Inside Xmp file, there is  more than one "place" where these four values can be stored -meaning, LR uses "this", but ACDsee migh use "that", etc. So, possible solution would be:

A - When copying, user defines which four location tags he wish to copy from Xmp (that's what I prefer).
B - Complete Xmp content is copied into destination file. In this case user wouldn't need to bother with defining tags, but keep in mind, that besides what you realy need, a lot of "garbage" inside Xmp will also be copied (and I don't like that at all).

I'm sure, that this can be done by using ExifTool direct. I mean, that's why this option exist in first place: you adapt commands according to your needs! You only need to know what tag values from Xmp file you wish to copy -and you need to know that anyway (see A solution above). So, tell us what tags you wish to copy, and I will try to help you with "complete" command. So, no need to wait for next update.

Bogdan

bobfrost

Thanks Bogdan,

From what I can tell, the five tags I want to copy from the xmp sidecar to xmp in the nef file are:-

XMP-IptcCore - CountryCode

XMP-IptcCore - Location

XMP-Photoshop - City

XMP-Photoshop - State

XMP-Photoshop - Country

I've been trying to put these into an .args file that works, as with Phil's xmp2gps.args file, but haven't succeeded yet!!

Any help would be appreciated.

Thanks,

Bob Frost

Phil Harvey

An .args file to copy these 5 tags would be:

-XMP-iptcCore:CountryCode
-XMP-iptcCore:Location
-XMP-photoshop:City
-XMP-photoshop:State
-XMP-photoshop:Country


and in exiftool direct, this could be used like this:

-tagsfromfile %f.xmp -@ c:\some\directory\my.args

- 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 ($).

bobfrost

Thanks Phil. I hesitated to ask you since I read somewhere on your forum that you had hundreds of things 'to do' on your list. I had looked at several of your supplied .args, but hadn't quite got the details correct.

Back to work!

Bob Frost

BogdanH

Hi Phil,
Thank you for helping on this -again, I'm too slow on typing  :)

To Bob,
Before you run above command in GUI, don't forget to select nef files you wish to modify.

Bogdan

Phil Harvey

Hi Bob,

Quote from: bobfrost on February 04, 2012, 10:05:44 AM
I hesitated to ask you since I read somewhere on your forum that you had hundreds of things 'to do' on your list.

Don't worry about this.  Helping people with their problems is always my top priority.

- 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 ($).

bobfrost

It works!!! ;D


Thanks to both of you. All I have to do now is add the GPS data to the same .args, and save it in GUI and if that works, I'll celebrate with a few pints tonight!!

Bob Frost

BogdanH

Hi Bob,

I'm glad hearing it works  :)

To copy GPS data as well, try adding following into args file:
-GPS:GPSLatitude<Xmp-exif:GPSLatitude
-GPS:GPSLongitude<Xmp-exif:GPSLongitude
-GPS:GPSLatitudeRef<Composite:GPSLatitudeRef
-GPS:GPSLongitudeRef<Composite:GPSLongitudeRef

and perhaps this:
-GPS:GPSDateStamp<XMP-exif:GPSDateTime
-GPS:GPSTimeStamp<XMP-exif:GPSDateTime


Bogdan

bobfrost

Now you've lost me again!

-GPS:GPSLatitude<Xmp-exif:GPSLatitude

Does the second part (after the <) mean copy it into XMP as well as into Exif? I was trying to make sense of Phil's .args, and noted he had lots of < symbols. I wasn't sure if this was just because he was typing the stuff onto one continuous line, or whether it meant something else like above.

Bob Frost

BogdanH

#12
Hi Bob,

Quote from: bobfrost on February 04, 2012, 12:07:57 PM
Now you've lost me again!

-GPS:GPSLatitude<Xmp-exif:GPSLatitude

Does the second part (after the <) mean copy it into XMP as well as into Exif?
It means copy from -Xmp-exif:GPSLatitude (here's where Xmp file holds Latitude value, if at all) into Exif, as -GPSLatitude tag (here's where GPS data belongs and is expected by 99.9% of software).

So, you can think of "<" as copy from one tag into another destination tag ..which has different name as source tag and/or resides in different metadata area than source tag (from Xmp to Exif in this case).

The same result can be achieved with:
-exif:GPSLatitude<Xmp-exif:GPSLatitude
..because there's only one GPSLatitude tag in Exif anyway.

Bogdan

Phil Harvey

...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 ($).

bobfrost

Thanks to both of you. It did help to read more of the instructions!

Bob Frost