Skip to content

Commit 52a5725

Browse files
committed
minor fixes
1 parent a38ab55 commit 52a5725

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

client-hc/src/main/java/com/graphhopper/api/GHMatrixBatchRequester.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,22 @@ public MatrixResponse route(GHMRequest ghRequest) {
6868
outArrayListJson.add(str);
6969
}
7070

71-
// TODO allow elevation for full path
7271
boolean hasElevation = false;
73-
requestJson.put("from_points", fromPointList);
74-
requestJson.put("to_points", toPointList);
75-
requestJson.put("out_arrays", outArrayListJson);
72+
requestJson.putArray("from_points").addAll(fromPointList);
73+
requestJson.putArray("to_points").addAll(toPointList);
74+
requestJson.putArray("out_arrays").addAll(outArrayListJson);
7675
requestJson.put("vehicle", ghRequest.getVehicle());
7776
requestJson.put("elevation", hasElevation);
7877

79-
ObjectNode hintsObject = factory.objectNode();
78+
ObjectNode hintsObject = requestJson.putObject("hints");
8079
Map<String, String> hintsMap = ghRequest.getHints().toMap();
81-
for(String hintKey : hintsMap.keySet()){
80+
for (String hintKey : hintsMap.keySet()) {
81+
if (ignoreSet.contains(hintKey))
82+
continue;
83+
8284
String hint = hintsMap.get(hintKey);
83-
hintsObject.put(hintKey,hint);
85+
hintsObject.put(hintKey, hint);
8486
}
85-
requestJson.put("hints",hintsObject);
8687

8788
boolean withTimes = outArraysList.contains("times");
8889
boolean withDistances = outArraysList.contains("distances");
@@ -91,12 +92,11 @@ public MatrixResponse route(GHMRequest ghRequest) {
9192
ghRequest.getFromPoints().size(),
9293
ghRequest.getToPoints().size(), withTimes, withDistances, withWeights);
9394

94-
boolean debug = ghRequest.getHints().getBool("debug", false);
95-
String postUrl = buildURL("/calculate", ghRequest);
95+
String postUrl = buildURLNoHints("/calculate", ghRequest);
9696

9797
try {
9898
String postResponseStr = postJson(postUrl, requestJson);
99-
99+
boolean debug = ghRequest.getHints().getBool("debug", false);
100100
if (debug) {
101101
logger.info("POST URL:" + postUrl + ", request:" + requestJson + ", response: " + postResponseStr);
102102
}

0 commit comments

Comments
 (0)