Bugfix tool for condensing POI.
This commit is contained in:
parent
3e68fd6f9a
commit
6135951d08
1 changed files with 16 additions and 0 deletions
|
@ -73,6 +73,22 @@ func condenseMinDist(xs []placenames.POI, minDist float64) []placenames.POI {
|
|||
cont = true
|
||||
break
|
||||
}
|
||||
if i == len(xs)-2 || p1 < p2 {
|
||||
xs = deleteElement(xs, i)
|
||||
cont = true
|
||||
break
|
||||
}
|
||||
d1 := xs[i].Distance - xs[i-1].Distance
|
||||
d2 := xs[i+1].Distance - xs[i].Distance
|
||||
if d1 < d2 {
|
||||
xs = deleteElement(xs, i)
|
||||
cont = true
|
||||
break
|
||||
} else {
|
||||
xs = deleteElement(xs, i+1)
|
||||
cont = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue