Extract GPS coordinates for all pictures in one file

Started by angelpoo, January 20, 2011, 07:15:12 PM

Previous topic - Next topic

wallfatt

Quote from: BenjaminTheThird on March 02, 2017, 10:29:04 PM
Hi Phil,
I'm having troubles with the command to extract the GPS data. It doesn't write the .txt file. Any ideas?


Hi all.
Im having the same issue. When i try:
exiftool -filename -directory -gpslatitude -gpslongitude -T -r DIR > out.txt

my txt is created, but its blank, despite i see a command line being create with all data that i wish (and closes after).
Im using windows 7.

Thanks for help.

Phil Harvey

If you are typing this command in a cmd.exe window then I don't see why it shouldn't work.

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

wallfatt

Quote from: Phil Harvey on April 10, 2017, 10:39:22 AM
If you are typing this command in a cmd.exe window then I don't see why it shouldn't work.

- Phil

Its on a cmd.exe window.

when i try simple "echo" command on a string to write on a txt, its works.
but exiftool data its not recorded on a txt when a use code above.

Phil Harvey

I don't understand it, but you can work around the problem by having ExifTool write the output text file with this command:

exiftool -filename -directory -gpslatitude -gpslongitude -T -r -W+! out.txt DIR

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

wallfatt

Still not working with this code.
When i run exiftool, a new cmd window is opened?
Maybe its the problem...

Phil Harvey

The steps are:

1. Run "cmd.exe"

2. Type your exiftool command in the cmd.exe window

If you do this, then a new cmd window should not open.  (or at least I don't understand why it would.  If it does, then something funny is going on)

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

wallfatt

Im doind exactly it, Phil.
And its opening a new cmd window. When this new cmd windows finishes, it closes fast and return to old cmd window (i can see command, but no results).

My exiftool.exe is in C:Windows folder

Trying to search now how to not open a new cmd window.
thanks anyway

wallfatt

problem solved.

i reduced windows defender level privileges and it worked.
thanks

Phil Harvey

Wow.  I would not have guessed that Windows Defender would cause another cmd.exe window to open.  That's just crazy.
...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 ($).

melkhafif

Hi Phil,
I followed your posts, thank you for all your help! I tried to export long/lat coordinates in decimal and the time from a bunch of geotagged images and am running into problems.
I am working on a Mac. Here is the code I am using:

exiftool -filename -gpslatitude -gpslongitude -time -T –n  DIR > out.csv

I am receiving an error..."n" is not found and is "time" not found.

Any Advice? I tried it yesterday with the simple code [without n and time] and it worked.

Best, Mona

Phil Harvey

Hi Mona,

What time are you trying to export?  GPSTimeStamp (and maybe GPSDateStamp too?) I assume.  And your -n problem is because the dash is not a minus character, but instead is some sort of unicode dash.

Try this:

exiftool -filename -gpslatitude -gpslongitude -gpstimestamp -gpsdatestamp -n DIR > out.csv

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

Rizki_633469

Hii Phil,
I want to ask, how to insert long,lat,alt, to images using exiftool?

i have problem to insert coordinate to my images?

Thank you,
Rizki

StarGeek

Under Windows, it's easier to write GPS coordinates if you have them in decimal format e.g. 40.6892, -74.0445.  Additionally, there is a reference tag for each value of Altitude, Latitude, and Longitude to account for whether the value is above/below sea level, North/South, or East/West.  So in the case of the above value, you could write:
exiftool -GPSLatitude=40.6892 -GPSLatitudeRef=N -GPSLongitude=-74.0445  -GPSLongitudeRef=W -GPSAltitude=10 -GPSAltitudeRef=Above

Exiftool is smart enough that you can just assign the GPS value to the associated reference tag and it will figure out the correct value (though you'll need a +/- for the GPSAltitudeRef):
exiftool -GPSLatitude=40.6892 -GPSLatitudeRef=40.6892 -GPSLongitude=-74.0445  -GPSLongitudeRef=74.0445 -GPSAltitude=10 -GPSAltitudeRef=+10

See GPS Tags for some further information.
"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

StarGeek

Quote from: StarGeek on July 12, 2017, 02:02:40 PMUnder Windows, it's easier to write GPS coordinates if you have them in decimal format

Replying to myself.  The problem I always had was trying to escape the double quotes for the seconds with DMS coordinates.  After re-reading the link I provided, I finally noticed that exiftool doesn't need those extra bits.  It will happily accept the DMS without them.  So -GPSLatitude="‎40 41 21.2892 N" -GPSLatitudeRef="‎40 41 21.2892 N" works perfectly well.  Today I learned.
"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

Rizki_633469

Thank you Star,

How about to inject coordinate using .csv file? i have problem when i do that.

Thank you for advice,
Rizki,