Geotagging: Add 'course' from gpx- or csv-file to Exif-data as 'GPSImgDirection'

Started by Chris75, May 25, 2011, 08:27:11 AM

Previous topic - Next topic

Chris75

Hello,

Is it possible to write via batch process in addition to the coordinates (lon/lat) also the 'course' information from gpx- or csv-file to Exif-data of JPGs as 'GPSImgDirection'?
0x0011 17 GPSInfo Exif.GPSInfo.GPSImgDirection – Rational: Indicates the direction of the image when it was captured. The range of values is from 0.00 to 359.99.

Do you have any idea how I can do this?

Thanks,
Chris

Phil Harvey

Hi Chris,

ExifTool does not do this.  Even if it did, it would store the value in the GPSTrack tag because one usually can't assume that the camera is pointed in the direction of motion.

If you are doing this yourself I recommend using a Kalman filter since the errors on each GPS position will give an unreliable direction if any of the usual interpolation methods are used.

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

Chris75

Hi Phil,

Thank you very much for your prompt reply and input.  :)

I just want to store the course information from the gpx-files as a kind of approximation to the exif-data 'GPSImgDirection' of the jpg-files, with the assumption that the direction of the movement is the same as the camera direction (knowing it is not). Of course the results will not be that accurate but for my task it's good enough and not needed to go for a more precise Kalman filter approch.

Do you have an idea how I can write the information to the jpg-files?  ???

Best regards,
Christian

Phil Harvey

Hi Chris,

Writing the information is easy.  From the command line:

exiftool -gpsimgdirection=30 FILE

or via the API

$exifTool->SetNewValue(GPSImgDirection => 30);

The difficulty is of course calculating the value to write.

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

Chris75

Hi Phil,

Thanks again!

Yep, that seams to be quite a difficult issue to calculate the course values of the gpx-file to the images.  :(

I have seen that in Geosetter it is possible to add the image direction manually to an image but I'd like to do this in a batch job to e.g. 2000 images.

Greets,
Christian

Phil Harvey

Hi Chris,

Does GeoSetter calculate the GPSTrack direction?  If so, you could use exiftool to copy this to GPSImgDirection.  I haven't used GeoSetter so I don't know if it does this, but it may.

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

Chris75

Hi Phil,

It seams that the Geosetter displays the image direction when it's available in the jpg or imports/calculates it when the course is available in an nmea-file coming from a compass (e.g. Solmeta). I don't know the details on the formats used in Geosetter.

I also tested a software named GPS Track Analyse. This tool is listing the course information but there is no possibility to store it in the image - it's only possible to geotag the gpx-file and the images and save the image incl. the coordinates.

Best,
Christian