Update OpenstreetmapRemoteUtil.java

This commit is contained in:
vshcherb 2020-12-07 13:20:43 +01:00 committed by GitHub
parent c413626490
commit 7af466ea1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -417,8 +417,9 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil {
}
}
}
} else if (MapUtils.getDistance(n.getLatLon(), entity.getLatLon()) < 10) {
// avoid shifting due to round error
} else if (MapUtils.getDistance(n.getLatLon(), entity.getLatLon()) < 10 ||
MapUtils.getDistance(n.getLatLon(), entity.getLatLon()) > 10000) {
// avoid shifting due to round error and avoid moving to more than 10 km
n.setLatitude(entity.getLatitude());
n.setLongitude(entity.getLongitude());
}