Skip to content

Instantly share code, notes, and snippets.

@iRGBit
Last active May 27, 2017 01:21
Show Gist options
  • Select an option

  • Save iRGBit/cde5e5f4224efb3c4e91df2ba6264ae7 to your computer and use it in GitHub Desktop.

Select an option

Save iRGBit/cde5e5f4224efb3c4e91df2ba6264ae7 to your computer and use it in GitHub Desktop.
import gpxpy
import gpxpy.gpx
gpx_file = open('activity_1758925412.gpx', 'r')
vid_framerate = 30
vid_startframe = 9140
now = vid_startframe
vid_name = 'papawai-imgs-'
gpx = gpxpy.parse(gpx_file)
for track in gpx.tracks:
for segment in track.segments:
for point in segment.points:
for frame in range(0,vid_framerate):
filename = '{0}{1}{2}'.format(vid_name, '%.5d' % now, '.jpg')
print '{0}, {1}, {2}, {3}'.format(point.latitude, point.longitude, point.elevation, filename)
now+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment