Where is the "turn left" text and bbox in ResponsePath?

In JS-api we can get “turn left” in RESULT.paths[0].instructions[0].text, and RESULT.paths[0].bbox.
In java-api, there was no bbox and text in GHResponse, I got the path by

GHResponse resp = hopper.route(req);

Where could I got the bbox and “turn left” in java?

I got it

InstructionList il = resp.getBest().getInstructions();
TranslationMap SINGLETON = new TranslationMap().doImport();
Translation esTR = SINGLETON.getWithFallBack(Locale.US);
String s = “”;
if (resp.getBest().getInstructions() != null) {
for(Instruction instruction : il) {
s += "\n "+instruction.getTurnDescription(esTR);
}
System.out.println(s);
}

It should probably be resp.getBest().getInstructions(). There is also resp.getBest().calcBBox2D() to get the bounding box.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.