Author Topic: GPS Longitude saves as +ve value in large tif  (Read 392 times)

clpratt

  • Full Member
  • **
  • Posts: 220
GPS Longitude saves as +ve value in large tif
« on: July 05, 2019, 05:29:56 PM »
I have a 1.27Gb tif pano (dimensions 27,226 x 8,322). I save a South Wales GPS location Lat 51.743689 Long -4.370775 to the file.
When I check the GPS location in the file it appears in the Netherlands at [/size]Lat 51.743689 Long 4.370775 i.e. the -ve sign is missing and it is now a positive Longitude. If I manually insert the -ve sign and resave it the Longitude returns to 4.370775.

Jingo

  • Super Hero
  • ****
  • Posts: 1173
Re: GPS Longitude saves as +ve value in large tif
« Reply #1 on: July 05, 2019, 06:07:40 PM »
See https://www.photools.com/community/index.php?topic=9073.0 for a possible solution (update exiftool).  Good luck!

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23039
Re: GPS Longitude saves as +ve value in large tif
« Reply #2 on: July 05, 2019, 06:12:26 PM »
You don't specify which version of IMatch you are using, but this was a problem in ExifTool that has been fixed with ExifTool 11.50, which is included in the current version of IMatch.

Information about this and solutions to identify and repair affected files have been given in the release notes, and in the original bug report linked to Jingo above.

Note that if you are an older IMatch version (pre 2019), compatibility with current ExifTool versions is not guaranteed or tested by me.

clpratt

  • Full Member
  • **
  • Posts: 220
Re: GPS Longitude saves as +ve value in large tif
« Reply #3 on: July 05, 2019, 10:05:45 PM »
I am using IMatch 2019.6.2 (64 bit) and ExifTool 11.50
The image has only just been added. whilst running these versions.

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23039
Re: GPS Longitude saves as +ve value in large tif
« Reply #4 on: July 06, 2019, 01:10:03 AM »
This bug has been reported as fixed by both Phil from ExifTool and IMatch users.

If you can still reproduce the problem,

1. Provide a sample image
2. Provide steps to reproduce (e.g. how and where you input your GPS coordinates)

When I can reproduce this here, I can inform Phil as needed.

clpratt

  • Full Member
  • **
  • Posts: 220
Re: GPS Longitude saves as +ve value in large tif
« Reply #5 on: July 08, 2019, 10:42:08 AM »
Hi Mario, I have done some more investigation regarding the GPS location errors in my large tif.
I have successfully edited the GPS locations in some of my CR2, jpg and small tif files using the metadata panel and map panel.
Using the Map panel or Metadata panel it is only my large pano tif that will not save the -ve GPS Lattitude or Longitude.
(Whenever I insert the -ve signs and save, both -ve get stripped out).
My tif is 1.3Gb. You may have a large tif of your own to try but I have made mine available at https://www.dropbox.com/s/0fpktmj626ctwpe/Carmarthen%20Bay%20Pano.tif?dl=0

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23039
Re: GPS Longitude saves as +ve value in large tif
« Reply #6 on: July 08, 2019, 01:32:32 PM »
I have downloaded the file, thank you.

Looking at the original file, I see this data:

[XMP-iptcExt]   Location Shown GPS Latitude     : 51.738652
[XMP-iptcExt]   Location Shown GPS Longitude    : 4.360133

[XMP-drone-dji] GPS Latitude                    : 51.738652
[XMP-drone-dji] GPS Longitude                   : 4.360133

[XMP-exif]      GPS Altitude                    : 9.93
[XMP-exif]      GPS Latitude                    : 51.738652
[XMP-exif]      GPS Longitude                   : 4.360133
[XMP-exif]      GPS Version ID                  : 2.3.0.0

[GPS]           GPS Version ID                  : 2 3 0 0
[GPS]           GPS Latitude Ref                : N
[GPS]           GPS Latitude                    : 51.738652
[GPS]           GPS Longitude Ref               : E
[GPS]           GPS Longitude                   : 4.360133
[GPS]           GPS Altitude                    : 9.93


so all values agree that the file is W (longitude +4...)

When I now change the longitude to E by adding a - sign in front and write-back, I get this data in the file:

[XMP-iptcExt]   Location Shown GPS Latitude     : 51.738652
[XMP-iptcExt]   Location Shown GPS Longitude    : 4.360133
[XMP-drone-dji] GPS Latitude                    : 51.738652
[XMP-drone-dji] GPS Longitude                   : 4.360133

[XMP-exif]      GPS Altitude                    : 9.93
[XMP-exif]      GPS Latitude                    : 51.738652
[XMP-exif]      GPS Longitude                   : -4.360133
[XMP-exif]      GPS Version ID                  : 2.3.0.0

[GPS]           GPS Version ID                  : 2 3 0 0
[GPS]           GPS Latitude Ref                : N
[GPS]           GPS Latitude                    : 51.738652
[GPS]           GPS Longitude Ref               : E
[GPS]           GPS Longitude                   : 4.360133
[GPS]           GPS Altitude                    : 9.93


which is strange, because the XMP data is correct (as written by IMatch) but the GPS data has not been synchronized by ExifTool. I guess ExifTool is seeing the iptcEXT data or maybe even the wrong data written by your drone and lets it override the GPS data. I have no idea.

Usually, this is how this works:

1. IMatch updates the XMP by some means. IMatch always uses the XMP::exif GPS coordinates internally.
2. You write back the modified data.
During this process, IMatch instructs ExifTool via the XMP2GPS.args file to map the GPS data from XMP into the standard GPS.
3. All done.

Why this fails in case of your file, I don't know. I could spend a couple of hours trying to figure this out, contacting Phil via the ExifTool user forum for advice etc. But I have spent to much time with bad or incomplete metadata analysis this month already that I'm all fed up. So many other things to do...

I fixed the problem by removing the XMP data already int he file (written by Adobe Lightroom and maybe your drone, presumably).
When I now let IMatch write back, it produces a complete XMP record and the GPS data is again synchronized between XMP and native GPS, as it should be.

[XMP-exif]      GPS Longitude                   : -4.360133
[GPS]           GPS Longitude Ref               : W
[GPS]           GPS Longitude                   : 4.360133
[Composite]     GPS Longitude                   : -4.360133
[Composite]     GPS Longitude Ref               : W


I have no time currently to dig deeper into this or figure out why ExifTool fails to synchronize the XMP GPS data back into native GPS for this particular file. Surely there is a dependency to one of the other XMP tags written by Lr or whatever. I don't know. Never seen this before. Analyzing such things can take hours or days. I don't currently have the time for this so I mark this as a 'obscure metadata side-effect' and close it.

You can delete the XMP data in the file with the ExifTool Command Processor (unless you really need it). In that case you would have to update all GPS data manually, including the IPTCExt and probably the drone data as well.
« Last Edit: July 08, 2019, 01:51:55 PM by Mario »

clpratt

  • Full Member
  • **
  • Posts: 220
Re: GPS Longitude saves as +ve value in large tif
« Reply #7 on: July 09, 2019, 02:11:10 PM »
Thank you Mario for looking at this. I appreciate that metadata is a real headache and realise that it's very time consuming and this case is hardly worth the time and effort you would to expend to investigate it further.
I have found something that may help when/if you decide to investigate further.
Using any method i.e. Map panel or Metadata panel I can update GPS coordinates in the problem file, but only the value gets updated, but the sign +/- or N/S/E/W does not.
It seems that the XMP DJI determines the sign for Latitude and Longitude. So, after setting Location I can then change the N/S E/W in XMP DJI GPS Latitude & GPS Longitude and everything is correct.


Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23039
Re: GPS Longitude saves as +ve value in large tif
« Reply #8 on: July 09, 2019, 03:23:39 PM »
I would rather say that the values in IPTC (XMP-iptcExt) override the values in XMP-exif in this case, and when mapping from XMP to GPS ExifTool prefers these tags instead of the XMP edit tags..? Not sure.
I have posted a question in the ET forum.
« Last Edit: July 09, 2019, 03:44:29 PM by Mario »

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23039
Re: GPS Longitude saves as +ve value in large tif
« Reply #9 on: August 11, 2019, 10:03:31 AM »
It seems that the latest ExifTool version handles this correctly and the native GPS latitude ref is updated (GPS does not support negative coordinates, unlike XMP which does not use separate ref fields).

NOTE: DO NOT UPDATE to a newer ExifTool yourself.

The latest ExifTool version changes some long-standing tag names and this needs to be handled by IMatch with a dedicated database migration step when moving to a new ExifTool version. I'm currently working on a solution.