News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Geotagging with ExifTool

Started by benvolio, May 25, 2020, 11:21:30 AM

Previous topic - Next topic

benvolio

Hello, I am looking for more info about Geotagging with ExifTool.

I'm interested in adding the tags mentioned at the top of this link to some JPEGs: https://exiftool.org/geotag.html

My question is: (Other than GPSPitch and GPSRoll which must be user-defined in a config file,) do I need a GPS track log file to add GPS tags to image? Can I add GPS tags and their accompanying values without using one of the GPS track log file formats mentioned in that link?

StarGeek

#1
You can directly set GPS tags just like any other tag with exiftool.  You can find the list of standard GPS tags on the GPS tag page.

One thing to remember is that some GPS tags are split into the base tag (GPSLatitude/GPSLongitude/GPSAltitude) and the directional reference tag (GPSLatitudeRef/GPSLongitudeRef/GPSAltitudeRef).  The latter holds the direction (N/S/E/W/Above/Below Sea Level).  Also, the GPS time data (GPSDateStamp/GPSTimeStamp) needs to be set to UTC time.

So, as an example
exiftool -GPSLatitude=40.6892 -GPSLatitudeRef=N -GPSLongitude=74.0445  -GPSLongitudeRef=W  -GPSTimeStamp=05:00:00 -GPSDateStamp=2020:05:25 /path/to/file/

But exiftool is quite flexible about the inputted values and you can pass the raw number to the Lat/Long reference and exiftool will figure it out.  With the time stamps, you can pass the whole value with the time zone and it will be adjusted.
exiftool -GPSLatitude=40.6892 -GPSLatitudeRef=40.6892 -GPSLongitude=-74.0445  -GPSLongitudeRef=-74.0445   -GPSTimeStamp="2020:05:25 12:00:00-07:00" -GPSDateStamp="2020:05:25 12:00:00-07:00" /path/to/file/

Some other useful info can be found under the -c (coordFormat) option and FAQ #14.

Edit: Witgh? How the heck did I type Witgh?
* 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).

benvolio

Thanks StarGeek, great answer, helped a lot!