can't seem to set GPS Lat/Lon after '-keys:GPSCoordinates<GPSPosition'

Started by bobo, September 17, 2020, 05:52:28 AM

Previous topic - Next topic

bobo

Hi,

I am trying to set keys:GPSCoordinates from the GPSPosition. I noticed that after setting this field, I can no longer update the default mapped -GPSLatitude=0.00 --GPSLongitude=0.00

First I set to 0/0, things are working.

exiftool '-GPSLatitude=0.00 -GPSLatitudeRef=0.00' '-GPSLongitude=0.00 -GPSLongitudeRef=0.00'  test.MOV -verbose
    1 image files updated
GPS Version ID                  : 2.3.0.0
GPS Latitude                    : 0 deg 0' 0.00" N
GPS Longitude                   : 0 deg 0' 0.00" E
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Position                    : 0 deg 0' 0.00" N, 0 deg 0' 0.00" E

Then I set to 5/3, things are working.

exiftool '-GPSLatitude=5.00 -GPSLatitudeRef=5.00' '-GPSLongitude=3.00 -GPSLongitudeRef=3.00' test.MOV -verbose
    1 image files updated
GPS Version ID                  : 2.3.0.0
GPS Latitude                    : 5 deg 5' 0.00" N
GPS Longitude                   : 3 deg 3' 0.00" E
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Position                    : 5 deg 5' 0.00" N, 3 deg 3' 0.00" E

As a sanity check I repeat the previous two more times to make sure that things are working.

Now I set the key based on the GPSPosition

exiftool '-keys:GPSCoordinates<GPSPosition' test.MOV -verbose
    1 image files updated

GPS Version ID                  : 2.3.0.0
GPS Coordinates                 : 5 deg 5' 0.00" N, 3 deg 3' 0.00" E
GPS Latitude                    : 5 deg 5' 0.00" N
GPS Longitude                   : 3 deg 3' 0.00" E
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Position                    : 5 deg 5' 0.00" N, 3 deg 3' 0.00" E


Great, it worked. However at this point, I can no longer updates GPS Latitude or Longitude.

Questions:
1 - is this because exiftool now has multiple GPS fields available and it doesn't know which to pick?
2 - if so, why is there no warning or error message - the indication is that the file was updated successfully.


exiftool '-GPSLatitude=0.00 -GPSLatitudeRef=0.00' '-GPSLongitude=0.00 -GPSLongitudeRef=0.00' test.MOV -verbose
1 image files updated
GPS Version ID                  : 2.3.0.0
GPS Coordinates                 : 5 deg 5' 0.00" N, 3 deg 3' 0.00" E
GPS Latitude                    : 5 deg 5' 0.00" N
GPS Longitude                   : 3 deg 3' 0.00" E
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Position                    : 5 deg 5' 0.00" N, 3 deg 3' 0.00" E



I get the impression that this is a newbie misunderstanding.

Using ExifTool 12.05 on Mac OSX 10.15.2, ZSH shell

Thank you,

- Borna

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

StarGeek

To break things down further
C:\>exiftool -P -overwrite_original -GPSLatitude=5.00 -GPSLatitudeRef=5.00 -GPSLongitude=3.00 -GPSLongitudeRef=3.00 Y:\!temp\Test1.mp4
    1 image files updated

C:\>exiftool -g1 -a -s -gps* Y:\!temp\Test1.mp4
---- XMP-exif ----
GPSLatitude                     : 5 deg 0' 0.00" N
GPSLongitude                    : 3 deg 0' 0.00" E
---- Composite ----
GPSLatitudeRef                  : North
GPSLongitudeRef                 : East
GPSPosition                     : 5 deg 0' 0.00" N, 3 deg 0' 0.00" E


Here you can see that you set the XMP:GPSLatitude/XMP:GPSLongitude.  The XMP GPS tags are meant to include the reference direction, as there are not XMP GPS reference tags.  As you can see, setting GPSLatitudeRef/GPSLongitudeRef in your original command did nothing.  The composite reference tags are derived from the XMP tags.  You can verify this by setting the main tags to a hemisphere opposite of the reference tags.  For example
C:\>exiftool -P -overwrite_original -GPSLatitude=-5.00 -GPSLatitudeRef=N -GPSLongitude=-5.00 -GPSLongitudeRef=E Y:\!temp\Test1.mp4
    1 image files updated

C:\>exiftool -g1 -a -s -gps* Y:\!temp\Test1.mp4
---- XMP-exif ----
GPSLatitude                     : 5 deg 0' 0.00" S
GPSLongitude                    : 5 deg 0' 0.00" W
---- Composite ----
GPSLatitudeRef                  : South
GPSLongitudeRef                 : West
GPSPosition                     : 5 deg 0' 0.00" S, 5 deg 0' 0.00" W


Even though I set the references to North and East, the output shows South and West.

Now going back to your original command and then setting the Quicktime tag
C:\>exiftool -P -overwrite_original -GPSLatitude=5.00 -GPSLongitude=3.00 Y:\!temp\Test1.mp4
    1 image files updated

C:\>exiftool -P -overwrite_original "-keys:GPSCoordinates<GPSPosition" Y:\!temp\Test1.mp4
    1 image files updated

C:\>exiftool -g1 -a -s -gps* Y:\!temp\Test1.mp4
---- Keys ----
GPSCoordinates                  : 5 deg 0' 0.00" N, 3 deg 0' 0.00" E
---- XMP-exif ----
GPSLatitude[tt]GPSLatitude[/tt]/[tt]GPSLongitude[/tt]                     : 5 deg 0' 0.00" N
GPSLongitude                    : 3 deg 0' 0.00" E
---- Composite ----
GPSLatitude                     : 5 deg 0' 0.00" N
GPSLongitude                    : 3 deg 0' 0.00" E
GPSLatitudeRef                  : North
GPSLongitudeRef                 : East
GPSPosition                     : 5 deg 0' 0.00" N, 3 deg 0' 0.00" E


Next, when you re-write the GPSLatitude/GPSLongitude and display the output
C:\>exiftool -P -overwrite_original -GPSLatitude=0.00 -GPSLatitudeRef=0.00 -GPSLongitude=0.00 -GPSLongitudeRef=0.00 Y:\!temp\Test1.mp4
    1 image files updated

C:\>exiftool -g1 -a -s -gps* Y:\!temp\Test1.mp4
---- Keys ----
GPSCoordinates                  : 5 deg 0' 0.00" N, 3 deg 0' 0.00" E
---- XMP-exif ----
GPSLatitude                     : 0 deg 0' 0.00" N
GPSLongitude                    : 0 deg 0' 0.00" E
---- Composite ----
GPSLatitude                     : 5 deg 0' 0.00" N
GPSLongitude                    : 3 deg 0' 0.00" E
GPSLatitudeRef                  : North
GPSLongitudeRef                 : East
GPSPosition                     : 5 deg 0' 0.00" N, 3 deg 0' 0.00" E


You can see that you did change the GPSLatitude/GPSLongitude, but the composite tags are derived from the GPSCoordinates tag instead of the XMP tags.

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

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

StarGeek

Because I have fun trying to explain the details, hopefully in an (semi-)easy to understand way and not in a patronizing way.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

bobo

Patronizing answers are required in society to get people to help themselves  :D

Non patronizing ones are also required to help people get going.

I appreciate both!

I was doing something like this:

exiftool test.MOV | grep GPS

Which was printing GPSLatitude the composit tag ... okay, I think I'm starting to get the hang of this tool.

Thanks,

- Borna

StarGeek

Take a look at my examples to see how to use a wildcard to skip the extra step of using grep.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype