moved string control to app worker

This commit is contained in:
afischerdev 2023-10-05 12:48:06 +02:00
parent 8d4012211e
commit 90cc045404
2 changed files with 4 additions and 5 deletions

View file

@ -133,7 +133,7 @@ public class RoutingParamCollector {
if (params.containsKey("profile")) { if (params.containsKey("profile")) {
rctx.localFunction = params.get("profile"); rctx.localFunction = params.get("profile");
} }
if (params.containsKey("nogoLats")) { if (params.containsKey("nogoLats") && params.get("nogoLats").length() > 0) {
List<OsmNodeNamed> nogoList = readNogos(params.get("nogoLons"), params.get("nogoLats"), params.get("nogoRadi")); List<OsmNodeNamed> nogoList = readNogos(params.get("nogoLons"), params.get("nogoLats"), params.get("nogoRadi"));
if (nogoList != null) { if (nogoList != null) {
RoutingContext.prepareNogoPoints(nogoList); RoutingContext.prepareNogoPoints(nogoList);
@ -324,9 +324,6 @@ public class RoutingParamCollector {
public List<OsmNodeNamed> readNogos(String nogoLons, String nogoLats, String nogoRadi) { public List<OsmNodeNamed> readNogos(String nogoLons, String nogoLats, String nogoRadi) {
if (nogoLons == null || nogoLats == null || nogoRadi == null) return null; if (nogoLons == null || nogoLats == null || nogoRadi == null) return null;
List<OsmNodeNamed> nogoList = new ArrayList<>(); List<OsmNodeNamed> nogoList = new ArrayList<>();
nogoLons = nogoLons.replace("[", "").replace("]", "");
nogoLats = nogoLats.replace("[", "").replace("]", "");
nogoRadi = nogoRadi.replace("[", "").replace("]", "");
String[] lons = nogoLons.split(","); String[] lons = nogoLons.split(",");
String[] lats = nogoLats.split(","); String[] lats = nogoLats.split(",");

View file

@ -86,7 +86,9 @@ public class BRouterWorker {
for (String key : params.keySet()) { for (String key : params.keySet()) {
Object value = params.get(key); Object value = params.get(key);
if (value instanceof double[]) { if (value instanceof double[]) {
theParams.put(key, Arrays.toString(params.getDoubleArray(key))); String s = Arrays.toString(params.getDoubleArray(key));
s = s.replace("[", "").replace("]", "");
theParams.put(key, s);
} else { } else {
theParams.put(key, value.toString()); theParams.put(key, value.toString());
} }