Skip to main content
lancelot21
Participating Frequently
January 1, 2020
Question

GPS location imported from iPhone has wrong hemisphere

  • January 1, 2020
  • 11 replies
  • 6236 views

In LR Classic 9.1, the Map module has the wrong hemisphere (E versus W) for the GPS location. So instead of showing the location as northern California, it shows it in China.

 

I exported iPhone photos from the Photos app on a Mac (export unmodified original; checked Export IPTC as XMP). When I look at the file itself in Preview, it shows the following (correct) coordinates (northern California):

 

Latitude: 40° 26’ 32.508” N
Longitude: 123° 59’ 20.04” W

 

 

I imported the photo into Lightroom, and it shows the following GPS coordinates (China).

 

40°26'32.508" 123°59'20.039"

 

If I manually add N and W to the GPS coordinates, then it shows the correct location.

 

I don't know what to do to correct this before I start editing/modifying thousands of photos!

 

 

11 replies

Participant
February 10, 2024

As of Feb 10th, 2024, the same problem persists. Just don't check the 'Export IPTC as XMP' . The embedded GPS data is fine, the XMP file is defective.

Participating Frequently
May 3, 2024

I've just discovered the same issue. What irks me is that while NeoFinder (a DAM on the Mac) and also ON1 RAW can both read the xmp file correctly Lightroom can't (both Desktop and Classic). The issue has been known for a number of years now and I don't understand why Adobe doesn't show any interest in addressing it. As for a work around, if you wish to keep both the keywords and gps data, and have ON1, before opening the files in LR, open them in ON1 and select 'Embed metadata' under the Photos tab. Once embedded in the file gps info shows correctly in LR along with any keywords. 

johnrellis
Legend
May 3, 2024

It's a bug in Apple Photos (see above). You should complain to Apple. 

Participating Frequently
November 15, 2020

The Apple Photos app has two Export options - one strips off the N W S E from the coordinates, the other options does Not. 

File > Export > Export x Photos...  does NOT strip off the N W S E 

File > Export > Export Unmodified Original for x Photos...   strips off the the directional indicators Do NOT use this export option if you wish to import useful GPS coordinates into Lightroom (or elsewhere).

Cheers!

johnrellis
Legend
April 12, 2020

"If you export originals and turn off the export IPTC as XMP option then the coordinates flow into Lightroom correctly."

 

That only works if the originals contain correct GPS coordinates. If you've added or changed the coordinates within Photos, then you need to turn on the option Export IPTC As XMP to get those coordinates.

 

[Use the blue reply button under the first post to ensure replies sort properly.]

johnrellis
Legend
April 12, 2020
Participant
February 28, 2020

The solution is actually simpler than what you have tried. The problem is the way MacOS Photos creates the XMP file. If you export originals and turn off the export IPTC as XMP option then the coordinates flow into Lightroom correctly. 

Participant
December 2, 2021

Not in case you have thousands of RAW files geotagged in Photos and want to move them to Lightroom... Then your only option is to export originals with XMP....

johnrellis
Legend
January 9, 2020

I'm glad you got a solution. But I'm not sure why my suggested command line didn't work for you -- I tested it on the .xmp files produced by Photos 5.  It takes the E/W stored in the .xmp's exif:GPSLongitudeRef and appends it to the end of the existing exif:GPSLongitude (ditto for exif:GPSLatitudeRef and exif:GPSLatitude). But your solution works too.

 

Exiftool does indeed have a steep learning curve. But it is by far the most authoritative tool for examining and modifying metadata.  I trust it much more than any tool from Adobe, Apple, Google, etc.

 

[Use the reply button under the first post to ensure replies sort properly.]

lancelot21
Participating Frequently
January 9, 2020

I don't know why your command line didn't work for me either. My only conjecture is that exiftool already added an E to the end of gpslongitude when it was missing. So it wouldn't append the correct W. For example, a texteditor shows that temp.xmp file has no direction at the end, just numbers:

 

     <exif:GPSLongitude>123.94116166999997</exif:GPSLongitude>

 

But when I run the following:

exiftool -xmp-exif:gpslongitude test.xmp

What I get back has added an E:

GPS Longitude                   : 123 deg 56' 28.18" E

 

In any case, you have been incredibly generous and helpful, so thank you. I am still a newby, but I've learned a little bit now about what exiftool can do:-) And I wish that Apple would fix its bug!

 

 

johnrellis
Legend
January 2, 2020

You can use the free Exiftool utility to fix the .xmp sidecars generated by Photos 5.0. Use this command line in Terminal:

 

exiftool \
  '-xmp-exif:gpslongitude<${xmp-exif:gpslongitude#}${xmp-exif:gpslongituderef#}' \
  '-xmp-exif:gpslatitude<${xmp-exif:gpslatitude#}${xmp-exif:gpslatituderef#}' \
  *.xmp

 

 

[Corrected to add the #'s, which tells Exiftool to use the raw values stored in the .xmp file.] 

 

[Use the reply button under the first post to ensure replies sort properly.]

lancelot21
Participating Frequently
January 7, 2020

Thanks for the helpful pointer! I wanted to be able to write back to say it had all worked, but it didn't....I started trying to figure out why--which got me more confused, and slowed me down.

 

The short answer appears to be: When I run exiftool on the image file (.heic), it gives the correct location. When I run it on the .xmp file that Photos 5.0 produces, it already has appended an (incorrect) "E" to the gpslongitude tag. That's presumably what Lightroom is also reading.

 

More confusingly to me, when I look at the .xmp file in a text editor, it looks different to me from what exiftool shows, in terms of GPS location.

 

My challenge is that I want Lightroom to import the keywords that are embedded in the .xmp file; otherwise, I would just throw away the .xmp file. One possibility would be to figure out how to get exiftool to copy the keywords from the .xmp files directly into the .heic files. Or else, I still need to figure out how to correct what's in the .xmp files. Both of those are beyond my exiftool skills, so advice would be very much appreciated.
 
Two example files are here. In a text editor, the (entire) .xmp file produced by Photos 5.0 looks like this:

 

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:dc="http://purl.org/dc/elements/1.1/"
            xmlns:exif="http://ns.adobe.com/exif/1.0/"
            xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
         <dc:subject>
            <rdf:Seq>
               <rdf:li>Rockefeller Redwoods</rdf:li>
               <rdf:li>Favorites</rdf:li>
               <rdf:li>Redwoods</rdf:li>
            </rdf:Seq>
         </dc:subject>
         <exif:GPSSpeedRef>K</exif:GPSSpeedRef>
         <exif:GPSSpeed>0.023617127910090144</exif:GPSSpeed>
         <exif:GPSTimeStamp>2019-12-30T22:31:15Z</exif:GPSTimeStamp>
         <exif:GPSImgDirection>174.43260959</exif:GPSImgDirection>
         <exif:GPSLongitudeRef>W</exif:GPSLongitudeRef>
         <exif:GPSAltitudeRef>0</exif:GPSAltitudeRef>
         <exif:GPSLongitude>123.94116166999997</exif:GPSLongitude>
         <exif:GPSLatitude>40.341178329999991</exif:GPSLatitude>
         <exif:GPSLatitudeRef>N</exif:GPSLatitudeRef>
         <exif:GPSImgDirectionRef>T</exif:GPSImgDirectionRef>
         <exif:GPSAltitude>51.200000000000003</exif:GPSAltitude>
         <exif:GPSHPositioningError>32.004833106781454</exif:GPSHPositioningError>
         <photoshop:DateCreated>2019-12-30T14:31:15-08:00</photoshop:DateCreated>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>

 

Most notably, neither <exif:GPSLongitude> nor <exif:GPSLatitude> have a direction (N or E/W).

 

In exiftool, the key fields from exiftool *.xmp show (with incorrect East):

 

Subject                         : Favorites, Redwoods
GPS Longitude                   : 123 deg 56' 28.18" E
GPS Latitude                    : 40 deg 20' 28.24" N
GPS Latitude Ref                : North
GPS Longitude Ref               : East

 


In contrast, when I run exiftool *.heic, it shows (correctly)

 

GPS Latitude Ref                : North
GPS Longitude Ref               : West
GPS Latitude                    : 40 deg 20' 28.24" N
GPS Longitude                   : 123 deg 56' 28.18" W

 


So in short, the .heic file is fine. The .xmp file is not.

 

So if possible, how do I get exiftool to add the Subject/keyword fields to the .heic file? Or else, how do I correct the GPS coordinates in the .xmp files? (I have probably 20K of them in all.) I feel like it should be easy, but it's beyond me, so any help would be appreciated. (I can also post this in a exiftool forum if that's the preferred location).

lancelot21
Participating Frequently
January 8, 2020

SOLVED. The following works for me in Mac command line (after installing exiftool) to copy the selected GPS tags from all of the .heic files into their respective .xmp files.

exiftool -tagsfromfile %d%f.heic -gpslongitude -gpslatitude -gpslongituderef -gpslatituderef -r -ext xmp /Users/lancelot/Pictures/Temp

 

As a newbie/ExifToolRefugee, it took me far too long to figure out how to even read the cryptic (to me) exiftool documentation, let alone decypher it and apply it to my example! But exiftool is, indeed, a powerful resource. 

 

My thanks to johnrellis for getting me started.  

 

johnrellis
Legend
January 2, 2020

The bug is with Mac Photos 5.0, not the iOS camera app. Mac Photos 4.0 generates GPS coordinates in the .xmp sidecar that conform to the industry standard:

<exif:GPSLatitude>37,22.01149980N</exif:GPSLatitude>
<exif:GPSLongitude>122,15.77629980W</exif:GPSLongitude>

But Mac Photos 5.0 generates GPS coordinates that do not conform:

<exif:GPSLongitudeRef>W</exif:GPSLongitudeRef>
<exif:GPSLongitude>118.06423907887489</exif:GPSLongitude>
<exif:GPSLatitudeRef>N</exif:GPSLatitudeRef>
<exif:GPSLatitude>43.874029118876422</exif:GPSLatitude>

See here for links to the standard:

https://exiftool.org/TagNames/XMP.html#exif

 

You could file a feature request in the official Adobe feedback forum to change LR to accommodate the Photos 5.0 bug:

https://feedback.photoshop.com/photoshop_family/categories/photoshop_family_photoshop_lightroom 

 

Product developers read everything posted there, but rarely participate here, which is primarily a user-to-user forum.

 

But in my opinion, that would be a waste of time, since I think it's highly unlikely Adobe would change LR to accommodate a simple Apple software bug in an Apple feature that's infrequently used.  It might be more productive to ask Adobe to ask Apple to fix the bug (since Adobe is likely to have much more sway with Apple than a mere consumer).

 

[Use the reply button under the first post to ensure replies sort properly.]

lancelot21
Participating Frequently
January 2, 2020

Thanks so much--this is very helpful for a relative newbie like me. I feel like I've been wrestling with Photos and Lightroom for longer than I wanted, and a little advice goes a long way to helping me find a workflow that gets me where I am trying to go.

johnrellis
Legend
January 2, 2020

"sometimes Lightroom gets it right, sometimes it doesn't"

 

If you want to understand why, upload two sample photos along with their .xmp sidecars (one that works with LR, one that doesn't) to Dropbox or similar and post the sharing link here. Perhaps the Photos bug is intermittent, or perhaps something else is going on.

lancelot21
Participating Frequently
January 2, 2020

I think I figured it what's going on.

 

I have been exporting unmodified originals with the associated XMP file that contains the GPS info (in Apple's format, not the conventions) as well as keywords. When the XMP file is there, Lightroom gets the file keywords from the Photos app but gets the GPS location wrong.  In contrast, when the XMP file is NOT there, the GPS info is embedded in the exported Photos app picture, and Lightroom reads that info correctly. However, the keywords were in the XPM file, not in the photo, so without the XMP file, the keywords don't carry over. 

 

(We can debate whose fault the GPS problems are. But the more relevant thing is that iPhones are more important to Adobe/Lightroom than Lightroom is to Apple. So Lightroom really should adjust.)

johnrellis
Legend
January 1, 2020

Mac Photos is generating incorrect XMP GPS metadata that doesn't conform to industry standards.  See this thread for additional details:

https://community.adobe.com/t5/lightroom-classic/exif-gps-data-gpslongituderef-gpslatituderef/m-p/10672337#M159671

 

You could try reporting this bug to Apple, but good luck with that -- Apple's about as responsive as Adobe.

 

[Use the reply button under the first post to ensure replies sort properly.]

lancelot21
Participating Frequently
January 2, 2020

Thanks. What surprises me is the inconsistency of it--sometimes Lightroom gets it right, sometimes it doesn't (so sometimes it figures out Apple's non-conforming XMP).  Even when it does, the Map view always has a label in the upper right that says "China" (see pic). I don't know where that comes from--I don't have any metadata presets on import.