Repository: graphhopper/graphhopper
Pull request #1075 (2017-05-29 07:22:51)

Enable keeps
This PR enables keeps, since our clients should reliable enough now.

I currently don't really like the naming "keep left onto ROAD_NAME". I think in this case only on would be better, but this would require a special case for keeps, so I am not sure if this is worth the change, whereas the German translation with `auf` would be fine.

We also need a symbol for the front-end.

devemux86: Well until lanes support! :slightly_smiling_face: 
karussell: > This PR enables keeps, since our clients should reliable enough now

We have to postpone this minor change as only recent versions of the clients are reliable enough. 
boldtrn: Ok, sure, no problem :).
karussell: Ok, we can merge this here now. @boldtrn would you mind update to the latest master? Sorry for the hassle ...
boldtrn: > Ok, we can merge this here now. @boldtrn would you mind update to the latest master? Sorry for the hassle ...

Done :)

Patch:
diff --git a/core/src/main/java/com/graphhopper/routing/InstructionsFromEdges.java b/core/src/main/java/com/graphhopper/routing/InstructionsFromEdges.java
index 85fc68c43..4278e995b 100644
--- a/core/src/main/java/com/graphhopper/routing/InstructionsFromEdges.java
+++ b/core/src/main/java/com/graphhopper/routing/InstructionsFromEdges.java
@@ -315,13 +315,9 @@ public class InstructionsFromEdges implements Path.EdgeVisitor {
                 }
 
                 if (otherDelta < delta) {
-                    // TODO Use keeps once we have a robust client
-                    //return Instruction.KEEP_LEFT;
-                    return Instruction.TURN_SLIGHT_LEFT;
+                    return Instruction.KEEP_LEFT;
                 } else {
-                    // TODO Use keeps once we have a robust client
-                    //return Instruction.KEEP_RIGHT;
-                    return Instruction.TURN_SLIGHT_RIGHT;
+                    return Instruction.KEEP_RIGHT;
                 }
 
 
diff --git a/core/src/main/resources/com/graphhopper/util/cs_CZ.txt b/core/src/main/resources/com/graphhopper/util/cs_CZ.txt
index f3d10be78..d8bc4e475 100644
--- a/core/src/main/resources/com/graphhopper/util/cs_CZ.txt
+++ b/core/src/main/resources/com/graphhopper/util/cs_CZ.txt
@@ -74,6 +74,6 @@ web.marker=Značka
 web.gh_offline_info=API GraphHopper je offline?
 web.refresh_button=Obnovit stránku
 web.server_status=Stav
-web.zoom_in=
-web.zoom_out=
+web.zoom_in=Přiblížit
+web.zoom_out=Oddálit
 web.drag_to_reorder=


Test patch:
diff --git a/core/src/test/java/com/graphhopper/routing/PathTest.java b/core/src/test/java/com/graphhopper/routing/PathTest.java
index 7ec8e0c5c..c2df7a627 100644
--- a/core/src/test/java/com/graphhopper/routing/PathTest.java
+++ b/core/src/test/java/com/graphhopper/routing/PathTest.java
@@ -538,7 +538,7 @@ public class PathTest {
         InstructionList wayList = p.calcInstructions(tr);
 
         assertEquals(3, wayList.size());
-        assertEquals(-1, wayList.get(1).getSign());
+        assertEquals(-7, wayList.get(1).getSign());
     }
 
     @Test
@@ -565,7 +565,7 @@ public class PathTest {
         InstructionList wayList = p.calcInstructions(tr);
 
         assertEquals(3, wayList.size());
-        assertEquals(-1, wayList.get(1).getSign());
+        assertEquals(-7, wayList.get(1).getSign());
     }
 
     @Test
@@ -645,7 +645,7 @@ public class PathTest {
         // Contain start, turn, and finish instruction
         assertEquals(3, wayList.size());
         // Assert turn right
-        assertEquals(1, wayList.get(1).getSign());
+        assertEquals(7, wayList.get(1).getSign());
     }
 
     @Test
diff --git a/core/src/test/java/com/graphhopper/util/InstructionListTest.java b/core/src/test/java/com/graphhopper/util/InstructionListTest.java
index e5f1f3fb1..66ef13394 100644
--- a/core/src/test/java/com/graphhopper/util/InstructionListTest.java
+++ b/core/src/test/java/com/graphhopper/util/InstructionListTest.java
@@ -233,7 +233,7 @@ public class InstructionListTest {
         p = new Dijkstra(g, new ShortestWeighting(carEncoder), tMode).calcPath(3, 5);
         wayList = p.calcInstructions(usTR);
         tmpList = pick("text", wayList.createJson());
-        assertEquals(Arrays.asList("Continue onto 3-4", "Turn slight right onto 4-5", "Arrive at destination"),
+        assertEquals(Arrays.asList("Continue onto 3-4", "Keep right onto 4-5", "Arrive at destination"),
                 tmpList);
     }
 
diff --git a/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java b/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java
index 1979b3a3c..e50bd1d5d 100644
--- a/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java
+++ b/reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java
@@ -661,12 +661,12 @@ public class GraphHopperIT {
 
         assertEquals("Turn right onto Pfarrplatz", resultJson.get(2).get("text"));
         assertEquals("Turn right onto Margarethenstraße", resultJson.get(3).get("text"));
-        assertEquals("Turn slight left onto Hoher Markt", resultJson.get(5).get("text"));
+        assertEquals("Keep left onto Hoher Markt", resultJson.get(5).get("text"));
         assertEquals("Turn right onto Wegscheid", resultJson.get(7).get("text"));
         assertEquals("Turn right onto Ringstraße, L73", resultJson.get(9).get("text"));
-        assertEquals("Turn slight left onto Eyblparkstraße", resultJson.get(10).get("text"));
-        assertEquals("Turn slight left onto Austraße", resultJson.get(11).get("text"));
-        assertEquals("Turn slight left onto Rechte Kremszeile", resultJson.get(12).get("text"));
+        assertEquals("Keep left onto Eyblparkstraße", resultJson.get(10).get("text"));
+        assertEquals("Keep left onto Austraße", resultJson.get(11).get("text"));
+        assertEquals("Keep left onto Rechte Kremszeile", resultJson.get(12).get("text"));
         //..
         assertEquals("Turn right onto Treppelweg", resultJson.get(19).get("text"));
         assertEquals("cycleway", resultJson.get(19).get("annotation_text"));