Replacing GPS coordinates in drone images

Started by JTMT, May 05, 2021, 06:42:07 AM

Previous topic - Next topic

JTMT

Hi everyone. Newbie here ;)

First off: wow... Exiftool is awesome, but yet a little intimidating for me :) So many options lol!

So, what I want to do is replace GPS coordinates in Lat, Long, Alt (see attachment) to the converted, projected coordinates in X Y Z, which I generate myself using another tool.

I already found this thread: https://exiftool.org/forum/index.php?topic=5771.0 but I couldn't make it work.

The values in the original csv are: image, lat, long, alt, accuracy (hor), accuracy (ver), omega, phi, kappa ... and I only need to replace lat, long and alt by X Y Z values from another csv.

Howww? :)

StarGeek

Quote from: JTMT on May 05, 2021, 06:42:07 AM
I already found this thread: https://exiftool.org/forum/index.php?topic=5771.0 but I couldn't make it work.

What exactly did you try?  Copy/pasting the command and output is essential to helping you and figuring out what went wrong.

Your image shows you didn't change the header line as detailed in step two of the post you linked.

So step by step
1. Assuming your image shows part of a spreadsheet, change the headers to match the data you want to embed.  From what you posted, the headers should be
SourceFile,GPSLatitude,GPSLongitude,GPSAltitude
2. Remove all other data that isn't going to be embedded in the file.
3. Save the spreadsheet as a CSV file.  Make sure the separator is a comma, not a semicolon.  I believe Excel will sometimes use the latter depending upon your computers location settings.
4. CD to the directory the files are located in.
5. Because the GPS reference direction tags are separate from the GPS coordinate tags, you will have to set them directly on the command line.  Alternatively, you could copy/paste to duplicate GPSLatitude/GPSLongitude/GPSAltitude columns in the spreadsheet and append Ref to the column headers.  That would give you these columns
SourceFile,GPSLatitude,GPSLongitude,GPSAltitude,GPSLatitudeRef,GPSLongitudeRef,GPSAltitudeRef
6.  Run this command if you didn't duplicate the headers, changing the reference directions as needed
exiftool -csv=/path/to/data.csv -gpslatituderef=N -gpslongituderef=W -gpsaltituderef=above .
or this if you did duplicate the headers
exiftool -csv=/path/to/data.csv .

See the -csv option and FAQ #26 for more details.
* 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).