diff --git a/brouter-core/src/main/java/btools/router/OsmTrack.java b/brouter-core/src/main/java/btools/router/OsmTrack.java index 8429aaef..ff13498f 100644 --- a/brouter-core/src/main/java/btools/router/OsmTrack.java +++ b/brouter-core/src/main/java/btools/router/OsmTrack.java @@ -452,7 +452,8 @@ public void processVoiceHints(RoutingContext rc) { voiceHints.setTransportMode(rc.carMode, rc.bikeMode); voiceHints.turnInstructionMode = rc.turnInstructionMode; - if (detourMap == null) { + if (detourMap == null && !rc.hasDirectRouting) { + // only when no direct way points return; } int nodeNr = nodes.size() - 1; @@ -487,13 +488,15 @@ public void processVoiceHints(RoutingContext rc) { input.distanceToNext = node.calcDistance(node.origin); } } - OsmPathElementHolder detours = detourMap.get(node.origin.getIdFromPos()); - if (nodeNr >= 0 && detours != null) { - OsmPathElementHolder h = detours; - while (h != null) { - OsmPathElement e = h.node; - input.addBadWay(startSection(e, node.origin)); - h = h.nextHolder; + if (detourMap != null) { + OsmPathElementHolder detours = detourMap.get(node.origin.getIdFromPos()); + if (nodeNr >= 0 && detours != null) { + OsmPathElementHolder h = detours; + while (h != null) { + OsmPathElement e = h.node; + input.addBadWay(startSection(e, node.origin)); + h = h.nextHolder; + } } } /* else if (nodeNr == 0 && detours != null) { diff --git a/brouter-core/src/main/java/btools/router/RoutingContext.java b/brouter-core/src/main/java/btools/router/RoutingContext.java index bd1c2366..0d6d3b57 100644 --- a/brouter-core/src/main/java/btools/router/RoutingContext.java +++ b/brouter-core/src/main/java/btools/router/RoutingContext.java @@ -203,6 +203,7 @@ public void readGlobalConfig() { public boolean showSpeedProfile; public boolean inverseRouting; public boolean showTime; + public boolean hasDirectRouting; public String outputFormat = "gpx"; public boolean exportWaypoints = false; diff --git a/brouter-core/src/main/java/btools/router/RoutingEngine.java b/brouter-core/src/main/java/btools/router/RoutingEngine.java index 7c2134c4..18d7149b 100644 --- a/brouter-core/src/main/java/btools/router/RoutingEngine.java +++ b/brouter-core/src/main/java/btools/router/RoutingEngine.java @@ -631,6 +631,8 @@ private OsmTrack tryFindTrack(OsmTrack[] refTracks, OsmTrack[] lastTracks) { } } + routingContext.hasDirectRouting = hasDirectRouting; + OsmPath.seg = 1; // set segment counter for (int i = 0; i < matchedWaypoints.size() - 1; i++) { if (lastTracks[i] != null) { diff --git a/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java b/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java index c3132e9f..ebc61c79 100644 --- a/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java +++ b/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java @@ -294,6 +294,11 @@ public List postProcess(List inputs, double catchingRange, nextInput = inputs.get(hintIdx + 1); } + if (input.cmd == VoiceHint.BL) { + results.add(input); + continue; + } + if (nextInput == null) { if ((input.cmd == VoiceHint.C || input.cmd == VoiceHint.KR ||