From 0d96394a0e19c13d589f988987944523814041c8 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 May 2020 20:15:16 +0200 Subject: [PATCH] Udpate planner --- .../java/net/osmand/router/TransportRoutePlanner.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java index 06821b20bd..599c664203 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -709,6 +709,9 @@ public class TransportRoutePlanner { public Map> missingStopsCache = new HashMap>(); public TLongObjectHashMap> quadTree; + // Here we don't limit files by bbox, so it could be an issue while searching for multiple unused files + // Incomplete routes usually don't need more files than around Max-BBOX of start/end, + // so here an improvement could be introduced public final Map> routeMap = new LinkedHashMap>(); @@ -834,7 +837,7 @@ public class TransportRoutePlanner { } } } - //there should go stops with complete routes: + // There should go stops with complete routes: loadTransportSegments(loadedTransportStops.valueCollection(), lst); readTime += System.nanoTime() - nanoTime; @@ -1101,7 +1104,7 @@ public class TransportRoutePlanner { private LinkedList> parseRoutePartsToSegments(List routeParts) { LinkedList> segs = new LinkedList>(); // here we assume that missing stops come in pairs - // TODO check generation that are doubles + // we don't add segments with 1 stop cause they are irrelevant further for (TransportRoute part : routeParts) { List newSeg = new ArrayList(); for (TransportStop s : part.getForwardStops()) { @@ -1122,8 +1125,8 @@ public class TransportRoutePlanner { private List findIncompleteRouteParts(TransportRoute baseRoute) throws IOException { List allRoutes = null; - // TODO completely irrelevant always reiteration over all maps (especially not in bbox of the route probabl) for (BinaryMapIndexReader bmir : routeMap.keySet()) { + // here we could limit routeMap indexes by only certain bbox around start / end (check comment on field) IncompleteTransportRoute ptr = bmir.getIncompleteTransportRoutes().get(baseRoute.getId()); if (ptr != null) { TIntArrayList lst = new TIntArrayList();