From 5e68bfdf690d8bc815ca5d7c0ae2f6a3ddc57225 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Thu, 19 Jun 2025 10:09:58 +0200 Subject: [PATCH 1/3] use profile parameter --- .../main/java/btools/routingapp/BRouterWorker.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterWorker.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterWorker.java index 437d136..3c87247 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterWorker.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterWorker.java @@ -100,11 +100,19 @@ public class BRouterWorker { } routingParamCollector.setParams(rc, waypoints, theParams); + Map profileParamsCollection = null; + try { + if (profileParams != null) { + profileParamsCollection = routingParamCollector.getUrlParams(profileParams); + routingParamCollector.setProfileParams(rc, profileParamsCollection); + } + } catch (UnsupportedEncodingException e) { + // ignore + } if (params.containsKey("extraParams")) { - Map profileparams = null; try { - profileparams = routingParamCollector.getUrlParams(params.getString("extraParams")); - routingParamCollector.setProfileParams(rc, profileparams); + profileParamsCollection = routingParamCollector.getUrlParams(params.getString("extraParams")); + routingParamCollector.setProfileParams(rc, profileParamsCollection); } catch (UnsupportedEncodingException e) { // ignore } From ac7ddddb62fa2fbe365baac3bc09fa6dac7cfe94 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Mon, 30 Jun 2025 12:36:30 +0200 Subject: [PATCH 2/3] added params in timeoutdata --- .../main/java/btools/routingapp/BRouterView.java | 14 ++++++++++++++ .../main/java/btools/routingapp/BRouterWorker.java | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java index 485d03f..092aac3 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java @@ -30,6 +30,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.TreeMap; import java.util.zip.ZipEntry; @@ -44,6 +45,8 @@ import btools.router.OsmTrack; import btools.router.RoutingContext; import btools.router.RoutingEngine; import btools.router.RoutingHelper; +import btools.router.RoutingParamCollector; + import btools.util.CheapRuler; public class BRouterView extends View { @@ -437,6 +440,7 @@ public class BRouterView extends View { public void startProcessing(String profile) { rawTrackPath = null; + String params = null; if (profile.startsWith(" 2) { + try { + Map profileParamsCollection = null; + RoutingParamCollector routingParamCollector = new RoutingParamCollector(); + profileParamsCollection = routingParamCollector.getUrlParams(params); + routingParamCollector.setProfileParams(rc, profileParamsCollection); + } catch (Exception e) {} + } + int plain_distance = 0; int maxlon = Integer.MIN_VALUE; int minlon = Integer.MAX_VALUE; diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterWorker.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterWorker.java index 3c87247..093b9f6 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterWorker.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterWorker.java @@ -221,6 +221,14 @@ public class BRouterWorker { bw.write("\n"); writeWPList(bw, waypoints); writeWPList(bw, rc.nogopoints); + if (rc.keyValues != null) { + StringBuilder sb = new StringBuilder(); + for (Map.Entry e : rc.keyValues.entrySet()) { + sb.append(sb.length()>0 ? "&" : "").append(e.getKey()).append("=").append(e.getValue()); + } + bw.write(sb.toString()); + bw.write("\n"); + } bw.close(); } From 00d74d930e4ab6f4147f37e8412001fa162a117b Mon Sep 17 00:00:00 2001 From: afischerdev Date: Mon, 7 Jul 2025 12:32:53 +0200 Subject: [PATCH 3/3] protect null pointer --- .../src/main/java/btools/routingapp/BRouterView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java index 092aac3..dc1c0a1 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java @@ -499,7 +499,7 @@ public class BRouterView extends View { rc.localFunction = profilePath; rc.turnInstructionMode = cor.getTurnInstructionMode(); - if (params != null || params.length() > 2) { + if (params != null && params.length() > 2) { try { Map profileParamsCollection = null; RoutingParamCollector routingParamCollector = new RoutingParamCollector();