From f8246c5cf476fbe85335281325046c6ace751175 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 25 May 2018 23:12:50 +0200 Subject: [PATCH] Fix #5003 --- .../src/net/osmand/binary/RouteDataObject.java | 13 +++++++++++++ .../src/net/osmand/router/RouteSegmentResult.java | 3 +++ 2 files changed, 16 insertions(+) diff --git a/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java b/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java index 6bf172ad4a..c599e471fe 100644 --- a/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java +++ b/OsmAnd-java/src/net/osmand/binary/RouteDataObject.java @@ -236,6 +236,7 @@ public class RouteDataObject { } return null; } + public String getName(String lang){ return getName(lang, false); @@ -684,6 +685,18 @@ public class RouteDataObject { } return direction; } + + public boolean isRoadDeleted() { + int[] pt = getTypes(); + int sz = pt.length; + for (int i = 0; i < sz; i++) { + RouteTypeRule r = region.quickGetEncodingRule(pt[i]); + if ("osmand_change".equals(r.getTag()) && "delete".equals(r.getValue())) { + return true; + } + } + return false; + } public boolean isStopApplicable(boolean direction, int intId, int startPointInd, int endPointInd) { int[] pt = getPointTypes(intId); diff --git a/OsmAnd-java/src/net/osmand/router/RouteSegmentResult.java b/OsmAnd-java/src/net/osmand/router/RouteSegmentResult.java index 77db8130f2..6ee9fbbb52 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteSegmentResult.java +++ b/OsmAnd-java/src/net/osmand/router/RouteSegmentResult.java @@ -71,6 +71,9 @@ public class RouteSegmentResult { } public void attachRoute(int roadIndex, RouteSegmentResult r){ + if(r.getObject().isRoadDeleted()) { + return; + } int st = Math.abs(roadIndex - startPointIndex); if(attachedRoutes[st] == null) { attachedRoutes[st] = new ArrayList();