Skip to content

Commit 9b7f44d

Browse files
authored
fix manhattan distance to sum of abs (#309)
1 parent 74cdecd commit 9b7f44d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xrspatial/proximity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def manhattan_distance(x1: float, x2: float,
114114

115115
x = x1 - x2
116116
y = y1 - y2
117-
return x * x + y * y
117+
return abs(x) + abs(y)
118118

119119

120120
@njit(nogil=True)

0 commit comments

Comments
 (0)