tkrajina / gpxpy

gpx-py is a python GPX parser. GPX (GPS eXchange Format) is an XML based file format for GPS tracks.
Apache License 2.0
1.01k stars 223 forks source link

Incremental distance / length? #240

Closed tomfrankkirk closed 1 year ago

tomfrankkirk commented 2 years ago

Sorry if I'm being thick and there is an obvious answer for this. I'm looking to get a running distance within a track. Ie, for each GPX point, the distance covered so far within that track.

Clearly, the various length(), length_2d(), length_3d() methods could do this, but they return a single flattened value (a reduction operation) whereas I would like the running total (aka cumulative sum I think?).

Happy to make the edit and submit a PR, just thought I would check first. Thanks.