Extract GPS coordinates from one file for all photos

Started by GRASSS, June 22, 2022, 12:56:13 PM

Previous topic - Next topic

GRASSS

In this thread there was a solution for Extract GPS coordinates for all pictures in one file.
https://exiftool.org/forum/index.php?topic=3075.0

Via the command line:
«exiftool -filename -gpslatitude -gpslongitude -T DIR > out.txt»

The output is a text file with this content:
001.jpg   51 deg 29' 53.74" N   0 deg 9' 3.30" W
002.jpg   51 deg 26' 29.72" N   0 deg 13' 40.16" W

Now I need to do the opposite.
I need the coordinates from a text file to be added to all the photos according to their name in the desired folder. How can I do this?

StarGeek

Quote from: GRASSS on June 22, 2022, 12:56:13 PM
I need the coordinates from a text file to be added to all the photos according to their name in the desired folder. How can I do this?

Exiftool can't directly read a simple text file.  You need to format it in specific ways.  The most obvious way would be to create a CSV file out of the data and use the -csv option to embed the data.  See FAQ #26 and see this post (section below the horizontal bar).
"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

GRASSS

Thank you very much.
Your information has helped me.
I decided to use a simple solution via the command line.
I will have a universal template where I simply insert the coordinates from the list for each photo.
exiftool -GPSLatitudeRef=S -GPSLatitude=52.5118940999833 -GPSLongitudeRef=E -GPSLongitude=13.4034490999972 img_001.jpg

GRASSS

Final version
exiftool -GPSLatitude*=51.4982620999222 -GPSLongitude*=-0.150917 F:\workgeo\www\traffic_001.jpg
exiftool -GPSLatitude*=51.441588 -GPSLongitude*=-0.227821299994444 F:\workgeo\www\traffic_002.jpg
exiftool -GPSLatitude*=51.4437278999556 -GPSLongitude*=-0.1873092 F:\workgeo\www\traffic_003.jpg