GPS metadata inconsistency

Started by Tom Cunningham, February 29, 2016, 04:46:08 PM

Previous topic - Next topic

Tom Cunningham

Now that Picasa is on the ropes, I've recently switched to digiKam to manage my photos.  I geotagged some photos with digiKam, and then noticed that on some photos previously geotagged with Picasa, the longitude value shows as positive and the Google map is in China (should be in Texas).  The weird thing is that, when I display the GPS EXIF data, either in digiKam or exiftool (via exiftoolGUI), the coordinates and references are consistent and seem fine; it's only on the map that things are wonky.  So it's probably a bug there, but I'm wondering what the GPS metadata differences are that make the map display correctly for photos geotagged with digiKam, but incorrectly for photos geotagged with Picasa, since in the textual format of the GPS data everything looks the same and is correct.  Is there some way in exiftool I could dump the raw GPS data and look for anomalies?

StarGeek

Try exiftool -g1 -gps* -a File.  That should show you all the GPS tags. 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Tom Cunningham

Quote from: StarGeek on February 29, 2016, 10:16:45 PM
Try exiftool -g1 -gps* -a File.  That should show you all the GPS tags.

This definitely showed me some things.  Here is data from a file that digiKam geotagged and which displays correctly on the Google map in digiKam:


---- GPS ----
GPS Version ID                  : 2.0.0.0
GPS Latitude Ref                : North
GPS Latitude                    : 40 deg 45' 31.97"
GPS Longitude Ref               : West
GPS Longitude                   : 73 deg 59' 6.46"
GPS Map Datum                   : WGS-84
---- XMP-exif ----
GPS Version ID                  : 2.0.0.0
GPS Map Datum                   : WGS-84
GPS Latitude Ref                : N
GPS Latitude                    : 40 deg 45' 31.97" N
GPS Longitude Ref               : W
GPS Longitude                   : 73 deg 59' 6.46" W
---- Composite ----
GPS Latitude                    : 40 deg 45' 31.97" N
GPS Latitude Ref                : North
GPS Longitude                   : 73 deg 59' 6.46" W
GPS Longitude Ref               : West
GPS Position                    : 40 deg 45' 31.97" N, 73 deg 59' 6.46" W


Now here is data from a file geotagged by Picasa and which does NOT display correctly on the Google map in digiKam:


---- GPS ----
GPS Version ID                  : 2.2.0.0
GPS Latitude Ref                : North
GPS Latitude                    : 35 deg 37' 24.37"
GPS Longitude Ref               : West
GPS Longitude                   : 95 deg 57' 37.98"
GPS Altitude Ref                : Above Sea Level
---- XMP-exif ----
GPS Altitude Ref                : Unknown (Sea level)
GPS Longitude                   : 95 deg 57' 37.98" E
GPS Longitude Ref               : W
GPS Version ID                  : 2.2.0.0
---- Composite ----
GPS Latitude                    : 35 deg 37' 24.37" N
GPS Longitude                   : 95 deg 57' 37.98" W
GPS Longitude Ref               : East
GPS Position                    : 35 deg 37' 24.37" N, 95 deg 57' 37.98" W


The latter seems to be a mess, at least in the XMP and Composite data: no latitude info, and a longitude ref that doesn't match the coordinate's suffix.  Is there a straightforward way to clean this up, maybe normalizing on the initial GPS data?

StarGeek

Is the data under the GPS heading correct?  If so, I'd probably remove the XMP data.  You could use a command like this:
exiftool -xmp:gps*= FileOrDir

Another option would be to correct the xmp data with the gps2xmp.args file that's in the main distribution.

You don't need to worry about the Composite entries, they'll be corrected once the rest of the data is corrected.

It seems like that DigiKam is prioritizing xmp entries over the GPS/EXIF entries. 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Tom Cunningham

Seems that way, gps2xmp.args fixed it, thanks for your help!  I'm wondering if the refs in the XMP data are necessary, since at least in the textual representation they are suffixes of the coordinates.  Also do you know, short of writing a script, if there's a way in exiftool to get the gps2xmp work done in place (e.g. source and destination are the same)?  I've got a lot of broken files per digiKam, apparently.  :-\

StarGeek

Quote from: Tom Cunningham on March 01, 2016, 01:20:06 PM
I'm wondering if the refs in the XMP data are necessary, since at least in the textual representation they are suffixes of the coordinates.

I wouldn't think so, but it probably doesn't hurt to for them to be there, as long as they're accurate.

Quote
Also do you know, short of writing a script, if there's a way in exiftool to get the gps2xmp work done in place (e.g. source and destination are the same)?  I've got a lot of broken files per digiKam, apparently.  :-\
I'm not quite sure I'm understanding you, but try this.  It will update the XMP in all the target files.  Add -r to recurse through subdirectories.  Try it out on some test files first to make sure it works.
exiftool -xmp:gps*= -@ gps2xmp.args FileOrDir
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).