diff --git a/brouter-mapaccess/src/main/java/btools/mapaccess/NodesCache.java b/brouter-mapaccess/src/main/java/btools/mapaccess/NodesCache.java index 2e7d0b2..f2a6316 100644 --- a/brouter-mapaccess/src/main/java/btools/mapaccess/NodesCache.java +++ b/brouter-mapaccess/src/main/java/btools/mapaccess/NodesCache.java @@ -285,7 +285,13 @@ public final class NodesCache { public void matchWaypointsToNodes(List unmatchedWaypoints, double maxDistance, OsmNodePairSet islandNodePairs) { waypointMatcher = new WaypointMatcherImpl(unmatchedWaypoints, maxDistance, islandNodePairs); for (MatchedWaypoint mwp : unmatchedWaypoints) { - preloadPosition(mwp.waypoint); + int cellsize = 12500; + preloadPosition(mwp.waypoint, cellsize); + // get a second chance + if (mwp.crosspoint == null) { + cellsize = 1000000 / 32; + preloadPosition(mwp.waypoint, cellsize); + } } if (first_file_access_failed) { @@ -309,8 +315,7 @@ public final class NodesCache { } } - private void preloadPosition(OsmNode n) { - int d = 12500; + private void preloadPosition(OsmNode n, int d) { first_file_access_failed = false; first_file_access_name = null; loadSegmentFor(n.ilon, n.ilat);