Improved duplicate suppression
This commit is contained in:
parent
34bdaeab71
commit
f740686d2f
1 changed files with 5 additions and 3 deletions
|
@ -73,10 +73,12 @@ func findDuplicates(points []RoutePoint, fuzz, minDist, maxDist float64) {
|
||||||
}
|
}
|
||||||
d := euclideanDistance(p.Coordinate, q.Coordinate)
|
d := euclideanDistance(p.Coordinate, q.Coordinate)
|
||||||
D := q.Distance - p.Distance
|
D := q.Distance - p.Distance
|
||||||
if d < fuzz && D > minDist && D < maxDist && (lastError == nil || p.Distance-lastError.Distance > 500) {
|
if d < fuzz && D > minDist && D < maxDist {
|
||||||
|
if lastError == nil || p.Distance-lastError.Distance > 500 {
|
||||||
|
fmt.Printf("Point (%0.f, %0.f) revisited at %0.2f km and %0.2f km\n",
|
||||||
|
p.Coordinate.Easting, p.Coordinate.Northing, p.Distance/1000.0, q.Distance/1000.0)
|
||||||
|
}
|
||||||
lastError = &p
|
lastError = &p
|
||||||
fmt.Printf("Point (%0.f, %0.f) revisited at %0.2f km and %0.2f km\n",
|
|
||||||
p.Coordinate.Easting, p.Coordinate.Northing, p.Distance/1000.0, q.Distance/1000.0)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue