Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ public void next(EdgeIteratorState edge, int index, int prevEdgeId) {
.setDirOfRotation(deltaOut)
.setExited();

// ORS-GH MOD START - additional instruction after exiting roundabout
prevInstruction = new Instruction(Instruction.CONTINUE_ON_STREET, name, new PointList(10, nodeAccess.is3D()));
ways.add(prevInstruction);
// ORS-GH MOD END

prevInstructionName = prevName;
prevName = name;

Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/com/graphhopper/GraphHopperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ public void withoutInstructions() {
// no simplification
hopper.getRouterConfig().setSimplifyResponse(false);
GHResponse routeRsp = hopper.route(request);
assertEquals(10, routeRsp.getBest().getInstructions().size());
assertEquals(11, routeRsp.getBest().getInstructions().size());
assertEquals(43, routeRsp.getBest().getPoints().size());

// with simplification
hopper.getRouterConfig().setSimplifyResponse(true);
routeRsp = hopper.route(request);
assertEquals(10, routeRsp.getBest().getInstructions().size());
assertEquals(39, routeRsp.getBest().getPoints().size());
assertEquals(11, routeRsp.getBest().getInstructions().size());
assertEquals(41, routeRsp.getBest().getPoints().size());

// no instructions
request.getHints().putObject("instructions", false);
Expand Down
7 changes: 7 additions & 0 deletions core/src/test/java/com/graphhopper/routing/PathTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ public void testCalcInstructionsRoundabout() {
List<String> tmpList = getTurnDescriptions(wayList);
assertEquals(Arrays.asList("continue onto MainStreet 1 2",
"At roundabout, take exit 3 onto 5-8",
"continue onto 5-8",
"arrive at destination"),
tmpList);
// Test Radian
Expand All @@ -249,6 +250,7 @@ public void testCalcInstructionsRoundabout() {
tmpList = getTurnDescriptions(wayList);
assertEquals(Arrays.asList("continue onto MainStreet 1 2",
"At roundabout, take exit 2 onto MainStreet 4 7",
"continue onto MainStreet 4 7",
"arrive at destination"),
tmpList);
// Test Radian
Expand All @@ -267,6 +269,7 @@ public void testCalcInstructionsRoundaboutBegin() {
InstructionList wayList = InstructionsFromEdges.calcInstructions(p, p.graph, weighting, mixedEncoders, tr);
List<String> tmpList = getTurnDescriptions(wayList);
assertEquals(Arrays.asList("At roundabout, take exit 3 onto 5-8",
"continue onto 5-8",
"arrive at destination"),
tmpList);
}
Expand All @@ -282,6 +285,7 @@ public void testCalcInstructionsRoundaboutDirectExit() {
List<String> tmpList = getTurnDescriptions(wayList);
assertEquals(Arrays.asList("continue onto 3-6",
"At roundabout, take exit 3 onto 5-8",
"continue onto 5-8",
"arrive at destination"),
tmpList);
roundaboutGraph.inverse3to9();
Expand Down Expand Up @@ -473,6 +477,7 @@ public void testCalcInstructionsRoundabout2() {
List<String> tmpList = getTurnDescriptions(wayList);
assertEquals(Arrays.asList("continue onto MainStreet 1 2",
"At roundabout, take exit 2 onto 5-8",
"continue onto 5-8",
"arrive at destination"),
tmpList);
// Test Radian
Expand Down Expand Up @@ -552,6 +557,7 @@ public void testCalcInstructionsRoundaboutIssue353() {
InstructionList wayList = InstructionsFromEdges.calcInstructions(p, p.graph, weighting, carManager, tr);
List<String> tmpList = getTurnDescriptions(wayList);
assertEquals(Arrays.asList("At roundabout, take exit 1 onto MainStreet 1 11",
"continue onto MainStreet 1 11",
"arrive at destination"),
tmpList);
}
Expand All @@ -567,6 +573,7 @@ public void testCalcInstructionsRoundaboutClockwise() {
List<String> tmpList = getTurnDescriptions(wayList);
assertEquals(Arrays.asList("continue onto MainStreet 1 2",
"At roundabout, take exit 1 onto 5-8",
"continue onto 5-8",
"arrive at destination"),
tmpList);
// Test Radian
Expand Down