GPS Tagging from CSV example file

Started by jeffjeff, January 22, 2017, 10:58:50 AM

Previous topic - Next topic

jeffjeff

Hi,
I've got a GPS receiver attached to an Arduino and i've been logging points to an SD card every time I take a photo as my camera does not have GPS on it.
I've read about GPX & KML files but these are more tricky and time-consuming to format correctly in the Arduino and then onto to the SD card. So, I have been happily writing these locations in a CSV format.

My question is, what is the format ordering (columns & titles) of a CSV file that can be best used with the Exif tool? I would really appreciate an example showing multiple times, co-ordinates & heights in a CSV file that would then be compatible with the bulk tagging command "exiftool -geotag my_gps.log C:\Images" once all the files have been time synced.

I have looked through many pages and FAQs, and I apologize if this is already there, but I really can't find it and this is just a perfect tool.

Cheers

Phil Harvey

Hi Jeff,

The format for a CSV file is like this:

SourceFile,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef,...
some.jpg,1.23425235,N,70.2312415,W,123.4,A
...


and the command would be:

exiftool -csv=test.csv DIR

But this would only be useful if you store one fix per file, and if your arduino somehow knows the file names.  But I doubt this is the case.

Otherwise, how do you correlate the arduino output with a specific file.  If by time, I would recommend writing NMEA format instead of CSV.  This is probably the simplest of the GPS log file formats that ExifTool will read via the -geotag option.  If you do this, the command would be:

exiftool -geotag=test.nmea DIR

(note that here I am technically writing the Geotag tag, and not using the -geotag option, but in reality they are the same thing -- the option is only provided for convenience and to make this feature more obvious in the documentation.)

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

jeffjeff

Thanks so much for the fast response.

Yes, I planned to match the file by date as your correct, the Arduino does not know the photo file names. In actual fact it looks like the data coming from the GPS receiver is in the NMEA format so this should work.

Do you know if the order of the NMEA information is critical for exif? is there a preferred messages type e.g. GPGGA, GPGLL etc.. ?

Thanks again.

Phil Harvey

I prefer GPRMC because it contains both date and time.  I don't think that order is important, but I have never actually tested this because I haven't ever seen a log that is out of order.

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

jeffjeff

Hi,
I've just tried a nmea file set that I had. but it's not working. I've attached the nmea (its a $GPGGA) file used and I get the following error message.
"Warning: No track points found in GPS file 'gps.nmea' in File:Geotag (ValueConvInv)"
I've aligned the time stamps using the command
exiftool -alldates+=00:00:32 C:\tmp\pics


Phil Harvey

The problem is that the GGA sentence is missing a few elements.  Although ExifTool doesn't care about the missing elements, it does require a comma after the last "M" in each line.

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