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 7b05fb6865..a7c5c08d66 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutePlanner.java @@ -38,6 +38,9 @@ public class TransportRoutePlanner { for(TransportRouteSegment s : endStops) { endSegments.put(s.getId(), s); } + if(startStops.size() == 0) { + return Collections.emptyList(); + } PriorityQueue queue = new PriorityQueue(startStops.size(), new SegmentsComparator(ctx)); for(TransportRouteSegment r : startStops){ r.walkDist = (float) MapUtils.getDistance(r.getLocation(), start); @@ -100,6 +103,7 @@ public class TransportRoutePlanner { } sgms.clear(); sgms = ctx.getTransportStops(stop.x31, stop.y31, true, sgms); + ctx.visitedStops++; for (TransportRouteSegment sgm : sgms) { if (ctx.calculationProgress != null && ctx.calculationProgress.isCancelled) { return null; @@ -197,9 +201,11 @@ public class TransportRoutePlanner { private List prepareResults(TransportRoutingContext ctx, List results) { Collections.sort(results, new SegmentsComparator(ctx)); List lst = new ArrayList(); - System.out.println(String.format("Calculated %.1f seconds, found %d results, visited %d routes, loaded %d tiles (%d ms read, %d ms total),", - (System.currentTimeMillis() - ctx.startCalcTime) / 1000.0, results.size(), ctx.visitedRoutesCount, - ctx.quadTree.size(), ctx.readTime / (1000 * 1000), ctx.loadTime / (1000 * 1000))); + System.out.println(String.format("Calculated %.1f seconds, found %d results, visited %d routes / %d stops, loaded %d tiles (%d ms read, %d ms total), loaded ways %d (%d wrong)", + (System.currentTimeMillis() - ctx.startCalcTime) / 1000.0, results.size(), + ctx.visitedRoutesCount, ctx.visitedStops, + ctx.quadTree.size(), ctx.readTime / (1000 * 1000), ctx.loadTime / (1000 * 1000), + ctx.loadedWays, ctx.wrongLoadedWays)); for(TransportRouteSegment res : results) { if (ctx.calculationProgress != null && ctx.calculationProgress.isCancelled) { return null; @@ -647,6 +653,7 @@ public class TransportRoutePlanner { // stats public long startCalcTime; public int visitedRoutesCount; + public int visitedStops; public int wrongLoadedWays; public int loadedWays; public long loadTime; diff --git a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutingConfiguration.java b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutingConfiguration.java index d2bf29d650..a046021ee2 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutingConfiguration.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutingConfiguration.java @@ -4,7 +4,7 @@ public class TransportRoutingConfiguration { public static final String KEY = "public_transport"; - public int ZOOM_TO_LOAD_TILES = 14; + public int ZOOM_TO_LOAD_TILES = 15; public int walkRadius = 1500; // ? 3000 diff --git a/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java b/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java index f033992a46..2368fef570 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java @@ -112,6 +112,7 @@ public class MapUtils { } + /** * Gets distance in meters */