Skip to content

Commit

Permalink
Explicit index to avoid error
Browse files Browse the repository at this point in the history
  • Loading branch information
ecomodeller committed Jul 12, 2023
1 parent c43dcb2 commit 6249ff8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mikeio/spatial/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6249ff8

Please sign in to comment.