use of com.graphhopper.util.RoundaboutInstruction in project graphhopper by graphhopper.
the class GraphHopperWebIT method readRoundabout.
@Test
public void readRoundabout() {
GHRequest req = new GHRequest().addPoint(new GHPoint(52.261434, 13.485718)).addPoint(new GHPoint(52.399067, 13.469238));
GHResponse res = gh.route(req);
int counter = 0;
for (Instruction i : res.getBest().getInstructions()) {
if (i instanceof RoundaboutInstruction) {
counter++;
RoundaboutInstruction ri = (RoundaboutInstruction) i;
assertEquals("turn_angle was incorrect:" + ri.getTurnAngle(), -1.5, ri.getTurnAngle(), 0.1);
// This route contains only one roundabout and no (via) point in a roundabout
assertEquals("exited was incorrect:" + ri.isExited(), ri.isExited(), true);
}
}
assertTrue("no roundabout in route?", counter > 0);
}
Aggregations