Fix rounding error in calcDistance
This commit is contained in:
parent
2387513a1f
commit
4495952625
3 changed files with 3 additions and 3 deletions
|
|
@ -100,7 +100,7 @@ public class OsmNode extends OsmLink implements OsmPos {
|
|||
}
|
||||
|
||||
public final int calcDistance(OsmPos p) {
|
||||
return (int) (CheapRuler.distance(ilon, ilat, p.getILon(), p.getILat()) + 1.0);
|
||||
return (int) Math.max(1.0, Math.round(CheapRuler.distance(ilon, ilat, p.getILon(), p.getILat())));
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue