Skip to content

Instantly share code, notes, and snippets.

@WouterNieuwerth
Last active February 9, 2020 13:39
Show Gist options
  • Save WouterNieuwerth/f255ff6be41a3b219f7a5fb28c1a79dd to your computer and use it in GitHub Desktop.
Save WouterNieuwerth/f255ff6be41a3b219f7a5fb28c1a79dd to your computer and use it in GitHub Desktop.
GPX analysis - step 3
for segment in gpx.tracks[0].segments: # all segments
data = segment.points
for point in data:
df = df.append({'lon': point.longitude, 'lat' : point.latitude, 'alt' : point.elevation, 'time' : point.time}, ignore_index=True)
df = df.sort_values(by=['time'])
df = df.reset_index()
df = df.fillna(method='ffill')
df = df.fillna(method='bfill')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment