<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx version="1.1" creator="Creator of the file">
<metadata> <!-- metadata of the file --> </metadata>
<wpt lat="xx.xxx" lon="yy.yyy"><!-- ... --></wpt>
<!-- more waypoints -->
<rte>
<!-- attributes of the route -->
<rtept lat="xx.xxx" lon="yy.yyy"><!-- ... --></rtept>
<!-- more route points -->
</rte>
<!-- more routes -->
<trk>
<!-- attributes of the track -->
<trkseg>
<trkpt lat="xx.xxx" lon="yy.yyy"><!-- ... --></trkpt>
<!-- more track points -->
</trkseg>
<!-- more track segments -->
</trk>
<!-- more tracks -->
</gpx>
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="Polar Flow">
<metadata>
<author>
<name>Polar</name>
</author>
<time>2016-04-17T08:02:12.000Z</time>
</metadata>
<trk>
<trkseg>
<trkpt lat="53.560591" lon="9.9755985">
<ele>17.0</ele>
<time>2016-04-17T08:02:12.000Z</time>
</trkpt>
<trkpt lat="53.560591" lon="9.9755985">
<ele>17.0</ele>
<time>2016-04-17T08:02:13.000Z</time>
</trkpt>
<!-- ... many more points -->
</trkseg>
</trk>
</gpx>
gpxinfo
cli tool for basic statsimport gpxpy
with open('./gpx/hh_marathon.gpx') as fh:
gpx_file = gpxpy.parse(fh)
segment = gpx_file.tracks[0].segments[0]
coords = pd.DataFrame([
{'lat': p.latitude,
'lon': p.longitude,
'ele': p.elevation,
'time': p.time} for p in segment.points])
coords.set_index('time', drop=True, inplace=True)
coords.head(3)
ele | lat | lon | |
---|---|---|---|
time | |||
2016-04-17 08:02:12 | 17.0 | 53.560591 | 9.975599 |
2016-04-17 08:02:13 | 17.0 | 53.560591 | 9.975599 |
2016-04-17 08:02:14 | 17.0 | 53.560561 | 9.975591 |
plt.plot(coords['lon'].values, coords['lat'].values);
plt.plot(coords['lon'].values, coords['lat'].values)
plt.plot(coords['lon'].values, coords['lat'].values, 'ro');
plt.plot(coords['lon'].values, coords['lat'].values)
plt.plot(coords['lon'].values[::150], coords['lat'].values[::150], 'ro');