Unverified Commit 52a57258 authored by Peter's avatar Peter

minor fixes

parent a38ab55d
......@@ -68,21 +68,22 @@ public class GHMatrixBatchRequester extends GHMatrixAbstractRequester {
outArrayListJson.add(str);
}
// TODO allow elevation for full path
boolean hasElevation = false;
requestJson.put("from_points", fromPointList);
requestJson.put("to_points", toPointList);
requestJson.put("out_arrays", outArrayListJson);
requestJson.putArray("from_points").addAll(fromPointList);
requestJson.putArray("to_points").addAll(toPointList);
requestJson.putArray("out_arrays").addAll(outArrayListJson);
requestJson.put("vehicle", ghRequest.getVehicle());
requestJson.put("elevation", hasElevation);
ObjectNode hintsObject = factory.objectNode();
ObjectNode hintsObject = requestJson.putObject("hints");
Map<String, String> hintsMap = ghRequest.getHints().toMap();
for(String hintKey : hintsMap.keySet()){
for (String hintKey : hintsMap.keySet()) {
if (ignoreSet.contains(hintKey))
continue;
String hint = hintsMap.get(hintKey);
hintsObject.put(hintKey,hint);
hintsObject.put(hintKey, hint);
}
requestJson.put("hints",hintsObject);
boolean withTimes = outArraysList.contains("times");
boolean withDistances = outArraysList.contains("distances");
......@@ -91,12 +92,11 @@ public class GHMatrixBatchRequester extends GHMatrixAbstractRequester {
ghRequest.getFromPoints().size(),
ghRequest.getToPoints().size(), withTimes, withDistances, withWeights);
boolean debug = ghRequest.getHints().getBool("debug", false);
String postUrl = buildURL("/calculate", ghRequest);
String postUrl = buildURLNoHints("/calculate", ghRequest);
try {
String postResponseStr = postJson(postUrl, requestJson);
boolean debug = ghRequest.getHints().getBool("debug", false);
if (debug) {
logger.info("POST URL:" + postUrl + ", request:" + requestJson + ", response: " + postResponseStr);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment