I have a number of sound files with timestamps (HH:MM:SS), made when walking a transect. I need to know where I was when each file was saved. To do this I have a GPX track of the route I took - I can extract the time for each point along the GPX track however the times don't match exactly with the sound files - the seconds aren't always the same.

These are my sound file time stamps:

Time       File 
19:32:53   1
19:34:26   2 
19:40:43   3 
19:40:47   4
19:49:21   5

These are the times of the GPX points:

Time       Latitude         Longitude
19:30:29   51.4463364054   -2.4129919242
19:37:44   51.4464039635   -2.4128513597
19:37:59   51.4464663249   -2.4127552193
19:38:01   51.4464837592   -2.4127533752
19:55:08   51.4465564303   -2.4127591588

So in the above example I need to estimate where I was at e.g. 19:34:26.

I could achieve this by removing the seconds however I would lose a lot of accuracy and would leave me with redundant coordinates.

Is it possible to do this in GIS? Or might it be best to plot this as a graph? Either way, how would I do this?

I'm on Linux and ideally would like to use Calc/Excel, QGIS or R.

  • See ?approxfun in R, you can use functions flon(newtime) and flat(newtime) created by approxfun(Time, Longitude) and approxfun(Time, Latitude)
    – mdsumner
    Sep 14, 2016 at 6:38

1 Answer 1


My approach here would be:

  • Convert position times to integer seconds (ie hours x 3600 + minutes x 60 + seconds)
  • Create a linear interpolation of the positions for every second (not sure how in Excel, but in python it is relatively straightforward, I'll assemble some bits of code and post a sample later)
  • pick interpolated positions at times which match your sound file times

That's it! Maybe QGIS-python functions to do this exist already?

Here's my whole process laid out in an ipython notebook - I hope it is followable, and translatable to the tools you're using:



  • Thanks for this. It looks like it should be straight forward to do a linear interpolation in Excel buy my worry was whether this would work with coordinates? Coordinates won't necessarily be linear with respect to time - would this be a problem? If I were to try this I guess I'd do Lat and Lon separately?
    – Thomas
    Sep 14, 2016 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.