Added stopped_speed_threshold to support slow movement

This commit is contained in:
Fmstrat 2021-10-13 21:33:25 -04:00
parent c944478fa0
commit dcb660cfe5

View File

@ -42,7 +42,7 @@ def get_gpx_data(
gpx_data['uphill'] = hill.uphill gpx_data['uphill'] = hill.uphill
gpx_data['downhill'] = hill.downhill gpx_data['downhill'] = hill.downhill
mv = parsed_gpx.get_moving_data() mv = parsed_gpx.get_moving_data(stopped_speed_threshold=0.1)
gpx_data['moving_time'] = timedelta(seconds=mv.moving_time) gpx_data['moving_time'] = timedelta(seconds=mv.moving_time)
gpx_data['stop_time'] = ( gpx_data['stop_time'] = (
timedelta(seconds=mv.stopped_time) + stopped_time_between_seg timedelta(seconds=mv.stopped_time) + stopped_time_between_seg
@ -105,8 +105,8 @@ def get_gpx_info(
if update_map_data: if update_map_data:
map_data.append([point.longitude, point.latitude]) map_data.append([point.longitude, point.latitude])
segment_max_speed = ( segment_max_speed = (
segment.get_moving_data().max_speed segment.get_moving_data(stopped_speed_threshold=0.1).max_speed
if segment.get_moving_data().max_speed if segment.get_moving_data(stopped_speed_threshold=0.1).max_speed
else 0 else 0
) )