Issue with GPSCoordinates expected formatting

Started by ManuBZH, January 08, 2024, 07:35:21 AM

Previous topic - Next topic

ManuBZH

Hello,
I'm trying to add MP4 videos geolocation data using "GPSCoordinates" metadata tag.
The problem is that I don't understand what is the expected format.

Based on previously found examples on this forum:

"exiftool(-k).exe" -Keys:GPSCoordinates="141.60508055555, 42.626330555555" DV_1_MOVIE0014_1_ddv3_stab_chf3.mp4
    1 image files updated

It seems to work, but actually only latitude is written.

"exiftool(-k).exe" -gpscoordinates DV_1_MOVIE0014_1_ddv3_stab_chf3.mp4
GPS Coordinates                 : 141 deg 36' 18.29" N,

I get the same result with '-n' and without comma...
Is there a reason for this behavior?

Thanks.

Phil Harvey

141 degrees north is not a valid latitude.

ExifTool could definitely handle erroneous inputs like this better.

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

Phil Harvey

I'll add a patch so you'll get a "Latitude out of range" warning for this case in version 12.73

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

ManuBZH

Oops! My mistake indeed I mixed up Latitude and Longitude.
Thank you for this error case "fix" anyway :)

Works better like this:
"exiftool(-k).exe" -Keys:GPSCoordinates="42.626330555555, 141.60508055555" DV_1_MOVIE0014_1_ddv3_stab_chf3.mp4
    1 image files updated

"exiftool(-k).exe" -gpscoordinates DV_1_MOVIE0014_1_ddv3_stab_chf3.mp4
GPS Coordinates                 : 42 deg 37' 34.79" N, 141 deg 36' 18.29" E

I was also wondering if there is a way to input the coordinates in degrees, for example:
42°37'35.37" N 141°36'16.44" E

Is it possible?
Thank you.

Phil Harvey

I'm going to use an argfile to avoid the whole quoting issue.  The command would be

exiftool -@ my.args FILE

with this my.args file:

-gpscoordinates=42°37'35.37" N, 141°36'16.44" E
- 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 ($).

StarGeek

Even though this is about the Quicktime tag and not the GPS tags, I assume that this line from the GPS tags page applies?
QuoteExifTool is very flexible about the input format when writing lat/long coordinates, and will accept from 1 to 3 floating point numbers (for decimal degrees, degrees and minutes, or degrees, minutes and seconds) separated by just about anything ...
* 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).

Phil Harvey

Yes, thanks.  That documentation applies.  Also FAQ 14.  For GPSCoordinates you have 2 coordinates in this format separated by a comma, which introduces a restriction that the individual coordinates themselves may not contain a comma.

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

ManuBZH

That's clear! Thanks a lot for your detailed answers.

StarGeek

Heh, tried to push it with this silly attempt
C:\>exiftool -P -overwrite_original -GPSCoordinates="42 robots fighting 37 aliens at 35.37 N Main Street, 141 pirates partying with  36 ninjas at 16.44 E Grand Ave" Y:\!temp\Test1.mp4
    1 image files updated

C:\>exiftool -G1 -a -s -GPSCoordinates Y:\!temp\Test1.mp4
[ItemList]      GPSCoordinates                  : 42 deg 37' 35.37" N, 141 deg 36' 16.44" E
* 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).

Phil Harvey

I give the edge to the aliens.  But if the pirates/ninjas are smart they'll wait until the aliens are done with the robots, then they should be able to take care of the rest.

- Phil

Edit: But note that the N/S and E/W aren't actually working because they have to come at the end of the coordinate.  NE is the default.  SW would be a better test.

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