aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2023-04-17 22:39:10 +0200
committerDaniel Schadt <kingdread@gmx.de>2023-04-17 22:39:10 +0200
commit4d900186a74ea8de144adeda32e71941b159d2a4 (patch)
tree780bde3ef42d4aefd0db7b77aaf39b081f193c44
parentf4e0fed0ca50b77f63fff5da26aec02a970013d2 (diff)
downloadfietsboek-4d900186a74ea8de144adeda32e71941b159d2a4.tar.gz
fietsboek-4d900186a74ea8de144adeda32e71941b159d2a4.tar.bz2
fietsboek-4d900186a74ea8de144adeda32e71941b159d2a4.zip
use gpx.walk() instead of manually implementing it
-rw-r--r--fietsboek/transformers/__init__.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/fietsboek/transformers/__init__.py b/fietsboek/transformers/__init__.py
index f6318d7..82f2a48 100644
--- a/fietsboek/transformers/__init__.py
+++ b/fietsboek/transformers/__init__.py
@@ -157,14 +157,11 @@ class FixNullElevation(Transformer):
def execute(self, gpx: GPX):
def all_points():
- return (
- point
- for track in gpx.tracks
- for segment in track.segments
- for point in segment.points
- )
+ return gpx.walk(only_points=True)
def rev_points():
+ # We cannot use reversed(gpx.walk(...)) since that is not a
+ # generator, so we do it manually.
return (
point
for track in reversed(gpx.tracks)