API - add coordinates in chart_data - #4

This commit is contained in:
Sam 2019-08-25 15:05:10 +02:00
parent d61b022035
commit f252620ac1
4 changed files with 11 additions and 1 deletions

View File

@ -908,6 +908,8 @@
<span class="nt">&quot;distance&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;duration&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;elevation&quot;</span><span class="p">:</span> <span class="mf">279.4</span><span class="p">,</span>
<span class="nt">&quot;latitude&quot;</span><span class="p">:</span> <span class="mf">51.5078118</span><span class="p">,</span>
<span class="nt">&quot;longitude&quot;</span><span class="p">:</span> <span class="mf">-0.1232004</span><span class="p">,</span>
<span class="nt">&quot;speed&quot;</span><span class="p">:</span> <span class="mf">8.63</span><span class="p">,</span>
<span class="nt">&quot;time&quot;</span><span class="p">:</span> <span class="s2">&quot;Fri, 14 Jul 2017 13:44:03 GMT&quot;</span>
<span class="p">},</span>
@ -915,6 +917,8 @@
<span class="nt">&quot;distance&quot;</span><span class="p">:</span> <span class="mf">7.5</span><span class="p">,</span>
<span class="nt">&quot;duration&quot;</span><span class="p">:</span> <span class="mi">7380</span><span class="p">,</span>
<span class="nt">&quot;elevation&quot;</span><span class="p">:</span> <span class="mi">280</span><span class="p">,</span>
<span class="nt">&quot;latitude&quot;</span><span class="p">:</span> <span class="mf">51.5079733</span><span class="p">,</span>
<span class="nt">&quot;longitude&quot;</span><span class="p">:</span> <span class="mf">-0.1234538</span><span class="p">,</span>
<span class="nt">&quot;speed&quot;</span><span class="p">:</span> <span class="mf">6.39</span><span class="p">,</span>
<span class="nt">&quot;time&quot;</span><span class="p">:</span> <span class="s2">&quot;Fri, 14 Jul 2017 15:47:03 GMT&quot;</span>
<span class="p">}</span>

File diff suppressed because one or more lines are too long

View File

@ -469,6 +469,8 @@ def get_activity_chart_data(auth_user_id, activity_id):
"distance": 0,
"duration": 0,
"elevation": 279.4,
"latitude": 51.5078118,
"longitude": -0.1232004,
"speed": 8.63,
"time": "Fri, 14 Jul 2017 13:44:03 GMT"
},
@ -476,6 +478,8 @@ def get_activity_chart_data(auth_user_id, activity_id):
"distance": 7.5,
"duration": 7380,
"elevation": 280,
"latitude": 51.5079733,
"longitude": -0.1234538,
"speed": 6.39,
"time": "Fri, 14 Jul 2017 15:47:03 GMT"
}

View File

@ -315,6 +315,8 @@ def get_chart_data(gpx_file):
'duration': point.time_difference(first_point),
'elevation': (round(point.elevation, 1)
if point.elevation is not None else 0),
'latitude': point.latitude,
'longitude': point.longitude,
'speed': speed,
'time': point.time,
})