diff options
| -rw-r--r-- | fietsboek/geo.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fietsboek/geo.py b/fietsboek/geo.py index 4daef06..ee26424 100644 --- a/fietsboek/geo.py +++ b/fietsboek/geo.py @@ -224,7 +224,13 @@ class Path: :return: An iterator over the climbs, represented by the starting index and ending index of points included in the climb. """ - return self._trimmed_climbs() + # After all the post-processing of climbs, it might happen that we get + # climbs shorter than the minimum amount again. Therefore, we do another + # filtering step here. + for (i, j) in self._trimmed_climbs(): + path = Path(self.points[i:j + 1]) + if path.movement_data().length >= CLIMB_MIN_LENGTH: + yield (i, j) def _trimmed_climbs(self): for i, j in self._merged_climbs(): |
