From 8190aaa92d647ba54241a5252114095658003a95 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Sat, 22 Apr 2023 12:45:36 +0200 Subject: [PATCH] update new exports --- .../src/main/java/btools/router/OsmPath.java | 2 +- .../src/main/java/btools/router/OsmTrack.java | 49 ++++++++++++------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/brouter-core/src/main/java/btools/router/OsmPath.java b/brouter-core/src/main/java/btools/router/OsmPath.java index 2e50ad6..1bf318b 100644 --- a/brouter-core/src/main/java/btools/router/OsmPath.java +++ b/brouter-core/src/main/java/btools/router/OsmPath.java @@ -138,8 +138,8 @@ abstract class OsmPath implements OsmLinkHolder { message.ele = Short.MIN_VALUE; message.linkdist = sourceNode.calcDistance(targetNode); message.wayKeyValues = "direct_segment=" + seg; + seg++; } - seg++; return; } diff --git a/brouter-core/src/main/java/btools/router/OsmTrack.java b/brouter-core/src/main/java/btools/router/OsmTrack.java index c57836a..670471c 100644 --- a/brouter-core/src/main/java/btools/router/OsmTrack.java +++ b/brouter-core/src/main/java/btools/router/OsmTrack.java @@ -613,7 +613,10 @@ public final class OsmTrack { } } sb.append(" \n"); - if (turnInstructionMode == 9) { // brouter style + if (turnInstructionMode == 9 + || turnInstructionMode == 2 + || turnInstructionMode == 8 + || turnInstructionMode == 4) { // Locus, comment, cruise, brouter style sb.append(" ").append(name).append("\n"); sb.append(" ").append(voiceHints.getTransportMode()).append("\n"); } else { @@ -644,14 +647,19 @@ public final class OsmTrack { if (showTime) { sele += ""; } - + if (turnInstructionMode == 8) { + if (mwpt != null && + !mwpt.name.startsWith("via") && !mwpt.name.startsWith("from") && !mwpt.name.startsWith("to")) { + sele += "" + mwpt.name + ""; + } + } boolean bNeedHeader = false; if (turnInstructionMode == 9) { // trkpt/sym style if (hint != null) { if (mwpt != null && - !mwpt.name.startsWith("via") && !mwpt.name.startsWith("from") && !mwpt.name.startsWith("end")) { + !mwpt.name.startsWith("via") && !mwpt.name.startsWith("from") && !mwpt.name.startsWith("to")) { sele += "" + mwpt.name + ""; } sele += "" + hint.getCruiserMessageString() + ""; @@ -741,17 +749,23 @@ public final class OsmTrack { if (turnInstructionMode == 2) { // locus style new if (hint != null) { if (mwpt != null) { + if (!mwpt.name.startsWith("via") && !mwpt.name.startsWith("from") && !mwpt.name.startsWith("to")) { + sele += "" + mwpt.name + ""; + } if (mwpt.direct && bNextDirect) { sele += "" + hint.getLocusSymbolString() + "pass_placeShaping"; // bNextDirect = false; } else if (mwpt.direct) { - sele += "pass_placeShaping"; + if (idx == 0) + sele += "pass_placeVia"; + else + sele += "pass_placeShaping"; bNextDirect = true; } else if (bNextDirect) { sele += "beeline" + hint.getLocusSymbolString() + "Shaping"; bNextDirect = false; } else { - sele += "" + hint.getLocusSymbolString() + ""; + sele += "" + hint.getLocusSymbolString() + "Via"; } } else { sele += "" + hint.getLocusSymbolString() + ""; @@ -787,28 +801,27 @@ public final class OsmTrack { } else { if (mwpt != null) { - if (sele.contains("sym") && - !sele.contains("name") && - !mwpt.name.startsWith("via") && - !mwpt.name.startsWith("from") && - !mwpt.name.startsWith("to")) { - int pos = sele.indexOf("" + mwpt.name + "" + sele.substring(pos) + "Via"; - } else if (sele.contains("sym") && mwpt.name.startsWith("via")) { - sele += "Via"; - } else if (mwpt.direct && bNextDirect) { + if (!mwpt.name.startsWith("via") && !mwpt.name.startsWith("from") && !mwpt.name.startsWith("to")) { + sele += "" + mwpt.name + ""; + } + if (mwpt.direct && bNextDirect) { sele += "beelinepass_placeShaping"; } else if (mwpt.direct) { - sele += "pass_placeShaping"; + if (idx == 0) + sele += "pass_placeVia"; + else + sele += "pass_placeShaping"; bNextDirect = true; + } else if (bNextDirect) { + sele += "beelinepass_placeShaping"; + bNextDirect = false; } else if (mwpt.name.startsWith("via") || mwpt.name.startsWith("from") || mwpt.name.startsWith("to")) { if (bNextDirect) { sele += "beelinepass_placeShaping"; } else { - sele += "pass_placeShaping"; + sele += "pass_placeVia"; } bNextDirect = false; } else {