diff --git a/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java b/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java index ac613904f3..dfbf11fb6c 100644 --- a/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java +++ b/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java @@ -554,8 +554,9 @@ public class BinaryRoutePlanner { RouteSegment from = !reverseWaySearch ? getParentDiffId(segment) : getParentDiffId(opposite); if (checkViaRestrictions(from, to)) { FinalRouteSegment frs = new FinalRouteSegment(road, segmentPoint); + // obstacles already count on backward calculation (so don't include obstaclesTime) float distStartObstacles = segment.distanceFromStart - + calculateTimeWithObstacles(ctx, road, segmentDist, obstaclesTime); + + calculateTimeWithObstacles(ctx, road, segmentDist, 0); frs.setParentRoute(segment); frs.setParentSegmentEnd(segmentPoint); frs.reverseWaySearch = reverseWaySearch; @@ -781,7 +782,7 @@ public class BinaryRoutePlanner { segment, segmentPoint); distFromStart += obstaclesTime; if (TEST_SPECIFIC && next.road.getId() >> 6 == TEST_ID) { - printRoad(" !? distFromStart=" + +distFromStart + " from " + segment.getRoad().getId() + + printRoad(" !? distFromStart=" +distFromStart + " from " + segment.getRoad().getId() + " dir=" + segment.getDirectionAssigned() + " distToEnd=" + distanceToEnd + " segmentPoint=" + segmentPoint + " -- ", next, true); @@ -793,7 +794,7 @@ public class BinaryRoutePlanner { next.distanceFromStart = distFromStart; next.distanceToEnd = distanceToEnd; if (TRACE_ROUTING) { - printRoad(" >>", next, null); + printRoad(" "+segmentPoint+">>" , next, null); } // put additional information to recover whole route after next.setParentRoute(segment); diff --git a/OsmAnd-java/src/net/osmand/util/MapUtils.java b/OsmAnd-java/src/net/osmand/util/MapUtils.java index a40dfcc598..321ffd798b 100644 --- a/OsmAnd-java/src/net/osmand/util/MapUtils.java +++ b/OsmAnd-java/src/net/osmand/util/MapUtils.java @@ -572,7 +572,7 @@ public class MapUtils { rect.bottom = MapUtils.get31LatitudeY((int) rect.bottom); return rect; } - + } diff --git a/OsmAnd-java/test/resources/test_routing.json b/OsmAnd-java/test/resources/test_routing.json index 4cb393b17d..3d03ff8992 100644 --- a/OsmAnd-java/test/resources/test_routing.json +++ b/OsmAnd-java/test/resources/test_routing.json @@ -24,7 +24,7 @@ { "testName": "5.Route depends on the distance to a junction, if routing engine takes the longer way https://github.com/osmandapp/Osmand/issues/1200", "description": "Подтверждается только неверный маршрут. От дистанции не зависит, но зависит от planRoadDirection. При -1 маршрут верный, при 0 - нет", - "ignore" : "true", + "ignore" : "false", "params": { "vehicle": "car", "short_way": "true",