GHResponse route() { StopWatch stopWatch = new StopWatch().start(); ArrayList<QueryResult> allQueryResults = new ArrayList<>(); QueryResult source = findClosest(enter, 0); QueryResult dest = findClosest(exit, 1); allQueryResults.add(source); allQueryResults.add(dest); queryGraph.lookup(Arrays.asList(source, dest)); // modifies queryGraph, source and dest! PointList startAndEndpoint = pointListFrom(Arrays.asList(source, dest)); response.addDebugInfo("idLookup:" + stopWatch.stop().getSeconds() + "s"); int startNode; int destNode; if (arriveBy) { startNode = allQueryResults.get(1).getClosestNode(); destNode = allQueryResults.get(0).getClosestNode(); } else { startNode = allQueryResults.get(0).getClosestNode(); destNode = allQueryResults.get(1).getClosestNode(); } List<List<Label.Transition>> solutions = findPaths(startNode, destNode); parseSolutionsAndAddToResponse(solutions, startAndEndpoint); return response; }
response.addDebugInfo("routing:" + stopWatch.stop().getSeconds() + "s"); if (discoveredSolutions.isEmpty() && router.getVisitedNodes() >= maxVisitedNodesForRequest) { throw new IllegalArgumentException("No path found - maximum number of nodes exceeded: " + maxVisitedNodesForRequest);
StopWatch sw = new StopWatch().start(); List<QueryResult> qResults = routingTemplate.lookup(points, encoder); ghRsp.addDebugInfo("idLookup:" + sw.stop().getSeconds() + "s"); if (ghRsp.hasErrors()) return Collections.emptyList(); queryGraph.lookup(qResults); weighting = createWeighting(hints, encoder, queryGraph); ghRsp.addDebugInfo("tmode:" + tMode.toString());
StopWatch sw = new StopWatch().start(); List<QueryResult> qResults = routingTemplate.lookup(points, encoder); ghRsp.addDebugInfo("idLookup:" + sw.stop().getSeconds() + "s"); if (ghRsp.hasErrors()) return Collections.emptyList(); queryGraph.lookup(qResults); weighting = createWeighting(hints, encoder, queryGraph); ghRsp.addDebugInfo("tmode:" + tMode.toString());
StopWatch sw = new StopWatch().start(); List<QueryResult> qResults = routingTemplate.lookup(points, encoder); ghRsp.addDebugInfo("idLookup:" + sw.stop().getSeconds() + "s"); if (ghRsp.hasErrors()) return Collections.emptyList(); queryGraph.lookup(qResults); weighting = createWeighting(hints, encoder, queryGraph); ghRsp.addDebugInfo("tmode:" + tMode.toString());
if (hints.has(Routing.EDGE_BASED)) tMode = hints.getBool(Routing.EDGE_BASED, false) ? TraversalMode.EDGE_BASED_2DIR : TraversalMode.NODE_BASED; ghRsp.addDebugInfo("tmode:" + tMode.toString()); ghRsp.addDebugInfo("idLookup:" + sw.stop().getSeconds() + "s"); if (ghRsp.hasErrors()) return Collections.emptyList();