@@ -68,21 +68,22 @@ public MatrixResponse route(GHMRequest ghRequest) {
68
68
outArrayListJson .add (str );
69
69
}
70
70
71
- // TODO allow elevation for full path
72
71
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 );
76
75
requestJson .put ("vehicle" , ghRequest .getVehicle ());
77
76
requestJson .put ("elevation" , hasElevation );
78
77
79
- ObjectNode hintsObject = factory . objectNode ( );
78
+ ObjectNode hintsObject = requestJson . putObject ( "hints" );
80
79
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
+
82
84
String hint = hintsMap .get (hintKey );
83
- hintsObject .put (hintKey ,hint );
85
+ hintsObject .put (hintKey , hint );
84
86
}
85
- requestJson .put ("hints" ,hintsObject );
86
87
87
88
boolean withTimes = outArraysList .contains ("times" );
88
89
boolean withDistances = outArraysList .contains ("distances" );
@@ -91,12 +92,11 @@ public MatrixResponse route(GHMRequest ghRequest) {
91
92
ghRequest .getFromPoints ().size (),
92
93
ghRequest .getToPoints ().size (), withTimes , withDistances , withWeights );
93
94
94
- boolean debug = ghRequest .getHints ().getBool ("debug" , false );
95
- String postUrl = buildURL ("/calculate" , ghRequest );
95
+ String postUrl = buildURLNoHints ("/calculate" , ghRequest );
96
96
97
97
try {
98
98
String postResponseStr = postJson (postUrl , requestJson );
99
-
99
+ boolean debug = ghRequest . getHints (). getBool ( "debug" , false );
100
100
if (debug ) {
101
101
logger .info ("POST URL:" + postUrl + ", request:" + requestJson + ", response: " + postResponseStr );
102
102
}
0 commit comments