You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all gpxpy is really great and I like that I can add the elevation so easily to a track with the help of srtm.py. I would be cool to have this feature also for the speed. There is get_moving_data that actually calculates what I want but does not return it. A function add_missing_speed would be nice that calculates and adds the smoothed speed to all the GPXTrackPoint points. A simple way of smoothing would be to assign the calculated speed from time and distance to the center of the line between to GPXTrackPoints. The speed at a GPXTrackPoint is now the weighted speed of the two adjoining lines. For the first and last GPXTrackPoint one would need to assume 0 or a cyclic boundary condition.
The text was updated successfully, but these errors were encountered:
Yes, I agree. I don't have the time to implement this properly now, but if you want to experiment, I just pushed a quick idea. It's in 7032e0f (branch: add-missing-speed). In the _add(...) function interval should contain points without .speed, start and end are points with .speed before and after the interval.
This (if it works) should only add missing speeds and it is not especially smart.
The smoothing should maybe be done in smooth() by changing:
First of all gpxpy is really great and I like that I can add the elevation so easily to a track with the help of srtm.py. I would be cool to have this feature also for the speed. There is
get_moving_data
that actually calculates what I want but does not return it. A functionadd_missing_speed
would be nice that calculates and adds the smoothed speed to all theGPXTrackPoint
points. A simple way of smoothing would be to assign the calculated speed from time and distance to the center of the line between toGPXTrackPoints
. The speed at aGPXTrackPoint
is now the weighted speed of the two adjoining lines. For the first and lastGPXTrackPoint
one would need to assume 0 or a cyclic boundary condition.The text was updated successfully, but these errors were encountered: