[GIS] Python libraries for correlating Photo to GPX file

coordinatesgeotaggpxphotospython

Can anyone recommend a Python library(s) that can geotag a photograph with the lat/long coordinates by correlating the timestamp of the photograph to the timestamp of a waypoint within a GPX file?

I am aware of desktop applications like GeoSetter which will do this for you, but I would like to write an automation procedure that I could run on a nightly basis that emulates this process:

  1. User takes a GPS and a camera into the field.
  2. User drops a folder onto a server with a GPX file and the photos taken that day.
  3. A Python process geotags the metadata each photo in the folder with the lat/long coordinates by comparing the photo timestamp to the nearest equivalent timestamp (+/- 30 seconds?) of a waypoint in the GPX file.
  4. Convert the coordinates found in the photo's metadata to a point in a GIS system.

I have procedures in place for steps 1, 2, & 4 but either need to find a library that already accomplishes step 3 or write my own. Any suggestions?

Best Answer

On the ArcGIS stack, there is the Match Photos To Rows By Time which you can use after you've imported your GPX files as point feature classes. From there if you need the GPS fix back in the EXIF tags, you could use pexif on the original files.