Latitude and Longitude tags being set as 0deg 0' 0"

Started by Bosnia, September 22, 2021, 04:26:52 PM

Previous topic - Next topic

Bosnia

Hello all,

First of all, I wanted to say thanks for this great tool and forum board. I've been having an issue when trying to assign EXIF data values for a directory of images using a GPS log. The exact command I'm using is the following:

exiftool -geosync="17:09:53@'image.JPG'" '-geotime<${DateTimeOriginal}+00:00'  -geotag=gps.csv Camera\ 1/


The tools does a great job assigning date, time, and lat/long references to each image in my directory but every single instance of lat/long GPS is written as 0deg 0' 0". The GPS lat/long data in the log is in a decimal degree format so I'm unsure if that is causing an issue. I tried manually assigning a single latitude value using the following:

exiftool -exif:gpslatitude=42.949079 -exif:gpslatituderef=N image.JPG

and it worked without an issue. I saw several references in other posts to https://exiftool.org/faq.html#Q14 and I tried understanding if that connects to the issue that I'm having but I am unsure if it does and, if so, how to proceed.

Here is an example of the GPS data in the log if that can help:




GPSDateTimeGPSLatitudeGPSLongitudeGPSLatitudeRefGPSLongitudeRef
2021:08:11 17:09:5347.92342-81.472311NW

Apologies for the noobie question but any help is greatly appreciate. Thanks.

Phil Harvey

What exactly does your CSV look like?  Can you paste the first 2 lines?  What you have shown isn't comma separated (CSV = Comma-Separated Values).

- 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

As Phil says, it has to be comma separated.  Not tabs or semicolons.  The first two lines should look like this in a text editor.  Also, no reference tags when using -Geotag on a csv file.  See ExifTool CSV Log File Format.
GPSDateTime,GPSLatitude,GPSLongitude
2021:08:11 17:09:53,47.92342,-81.472311


A quick test shows that the GPSLatitudeRef/GPSLongitudeRef columns are the problems.  They're being treated as GPSLatitude/GPSLongitude with a coordinate of 0, apparently overriding the previous columns.

edit: If you were using the -csv option, you would want to have the reference directions.  But then you also have to explicitly set the filename in the "SourceFile" column and you don't get the linear interpolation between timestamps.
"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

Bosnia

Quote from: Phil Harvey on September 22, 2021, 07:24:08 PM
What exactly does your CSV look like?  Can you paste the first 2 lines?  What you have shown isn't comma separated (CSV = Comma-Separated Values).

I'm sorry for the confusion. I created the table for a more readable format but it seems it didn't help. The lines are actually comma separated and here is an example of two lines:

GPSDateTime,GPSLatitude,GPSLongitude
321020.484337,2170,42.234059,-81.2234111,
321020.486825,2170,45.544379,-85.2443211,

As you can see, there are no longer columns for GPSLatitudeRef/GPSLongitudeRef because StarGeek's post helped fix the issue. Once I removed the reference columns, the images were geotagged without a problem. I guess this is what happens when you stray away from the documentation and start changing your inputs to match other peoples' solutions...

Thank you both for your help!

Phil Harvey

#4
Thanks StarGeek for figuring this out.  Yes, the ExifTool CSV format for geotagging doesn't support the Ref tags (read here).

FYI, you can see what the columns are used for with the -v3 option, which should have given you something like this:

> exiftool -geotag a.csv -v3 a.jpg
Argument "-Geotime<DateTimeOriginal#" is assumed
CSV column 'DateTime' is datetime
CSV column 'Latitude' is lat
CSV column 'Longitude' is lon
CSV column 'LatitudeRef' is lat
CSV column 'LongitudeRef' is lon
...


Edit: I'll enhance ExifTool 12.32 to support GPSLatitudeRef/GPSLongitudeRef columns in the -geotag CSV input.
...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 ($).