From 6249ff8fe98b3a6b7900ac204f44686e31c98ca3 Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Wed, 12 Jul 2023 08:19:53 +0000 Subject: [PATCH] Explicit index to avoid error --- mikeio/spatial/_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mikeio/spatial/_utils.py b/mikeio/spatial/_utils.py index 923058ee9..97c953d71 100644 --- a/mikeio/spatial/_utils.py +++ b/mikeio/spatial/_utils.py @@ -62,7 +62,7 @@ def _relative_cumulative_distance(coords, reference=None, is_geo=False): coords = np.atleast_2d(coords) d = np.zeros_like(coords[:, 0]) if reference is not None: - d[0] = dist_in_meters(coords[0, 0:2], reference[0:2], is_geo) + d[0] = dist_in_meters(coords[0, 0:2], reference[0:2], is_geo)[0] for j in range(1, len(d)): - d[j] = d[j - 1] + dist_in_meters(coords[j, 0:2], coords[j - 1, 0:2], is_geo) + d[j] = d[j - 1] + dist_in_meters(coords[j, 0:2], coords[j - 1, 0:2], is_geo)[0] return d