Bugfix tool for condensing POI.

This commit is contained in:
Ray Miller 2020-04-27 07:41:25 +01:00
parent 3e68fd6f9a
commit 6135951d08

View file

@ -73,6 +73,22 @@ func condenseMinDist(xs []placenames.POI, minDist float64) []placenames.POI {
cont = true cont = true
break 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
}
} }
} }
} }