Merge pull request #9847 from osmandapp/issues_158_no_ele_after_attach

Issues 158 no ele after attach
This commit is contained in:
vshcherb 2020-09-18 16:18:34 +02:00 committed by GitHub
commit b8927c568f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View file

@ -549,8 +549,10 @@ public class RoutePlannerFrontEnd {
if (start != null && start.pnt == null) {
gctx.routePointsSearched++;
RouteSegmentPoint rsp = findRouteSegment(start.loc.getLatitude(), start.loc.getLongitude(), gctx.ctx, null, false);
if (MapUtils.getDistance(rsp.getPreciseLatLon(), start.loc) < distThreshold) {
start.pnt = rsp;
if (rsp != null) {
if (MapUtils.getDistance(rsp.getPreciseLatLon(), start.loc) < distThreshold) {
start.pnt = rsp;
}
}
}
if (start != null && start.pnt != null) {

View file

@ -328,7 +328,7 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
for (int i = 0; i < length; i++) {
Location location = resources.getLocation(index);
if (location == null) {
break;
continue;
}
double dist = 0;
if (prevLocation != null) {

View file

@ -341,6 +341,10 @@ public class RouteCalculationResult {
LatLon point = s.getPoint(i);
n.setLatitude(point.getLatitude());
n.setLongitude(point.getLongitude());
//FIXME: investigate gpx file
if (s.getObject().getPoint31XTile(i) == 0 && s.getObject().getPoint31YTile(i) == 0){
break;
}
if (i == s.getEndPointIndex() && routeInd != list.size() - 1) {
break;
}