Skip to content

Commit 53ed032

Browse files
committed
douglas peucker : add test for doublon
1 parent 8611df9 commit 53ed032

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tracklib/algo/simplification.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ def douglas_peucker (track, eps):
190190
ya = L[0].position.getY()
191191
xb = L[n - 1].position.getX()
192192
yb = L[n - 1].position.getY()
193+
if abs(xa - xb) < 0.001 and abs(ya - yb) < 0.001:
194+
continue
195+
193196
d = distance_to_segment(x0, y0, xa, ya, xb, yb)
194197
if d > dmax:
195198
dmax = d

0 commit comments

Comments
 (0)