From e1b7f13b5c34f56f09526ae9c36774f6ce4a0597 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Sun, 16 Nov 2014 10:04:54 -0500 Subject: [PATCH 01/12] Implement merging nearby turns together. When there are multiple turns near each other (< 60m), set the lanes that are allowed on earlier turns such that staying on that lane will carry you through the other turns. For a standard left/right turn at a traffic light at two one-way roads (dual carriageway), this means that the left and right turns are correctly highlighted. --- .../osmand/router/RouteResultPreparation.java | 109 +++++++++++++++++- 1 file changed, 105 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 2fd6711a36..6646935eb8 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -40,7 +40,7 @@ public class RouteResultPreparation { splitRoadsAndAttachRoadSegments(ctx, result); // calculate time calculateTimeSpeed(ctx, result); - + addTurnInfo(ctx.leftSideNavigation, result); return result; } @@ -389,6 +389,76 @@ public class RouteResultPreparation { dist += result.get(i).getDistance(); } } + + for (int i = result.size() - 2; i >= 0; i--) { + RouteSegmentResult currentSegment = result.get(i); + RouteSegmentResult nextSegment = null; + + // We need to get the next segment that has a turn and lanes attached. + for (int j = i + 1; j < result.size(); j++) { + RouteSegmentResult possibleSegment = result.get(j); + if (possibleSegment.getTurnType() != null && possibleSegment.getTurnType().getLanes() != null) { + nextSegment = possibleSegment; + break; + } + } + + if (currentSegment.getTurnType() == null || currentSegment.getTurnType().getLanes() == null + || nextSegment == null) { + continue; + } + + // Only allow slight turns that are nearby to be merged. + if (currentSegment.getDistance() < 60 && nextSegment.getTurnType().getLanes().length <= currentSegment.getTurnType().getLanes().length + && (currentSegment.getTurnType().getValue() == TurnType.C + || currentSegment.getTurnType().getValue() == TurnType.TSLL + || currentSegment.getTurnType().getValue() == TurnType.TSLR + || currentSegment.getTurnType().getValue() == TurnType.KL + || currentSegment.getTurnType().getValue() == TurnType.KR)) { + mergeTurnLanes(leftside, currentSegment, nextSegment); + } + } + } + + private void mergeTurnLanes(boolean leftSide, RouteSegmentResult currentSegment, RouteSegmentResult nextSegment) { + boolean isUsingTurnLanes = TurnType.getPrimaryTurn(currentSegment.getTurnType().getLanes()[0]) != 0 + && TurnType.getPrimaryTurn(nextSegment.getTurnType().getLanes()[0]) != 0; + if (isUsingTurnLanes) { + int[] lanes = new int[currentSegment.getTurnType().getLanes().length]; + // Unset the allowed lane bit + for (int i = 0; i < lanes.length; i++) { + lanes[i] = currentSegment.getTurnType().getLanes()[i] & ~1; + } + + // Find the first lane that matches (based on the turn being taken), and how many lanes match + int matchingIndex = 0; + int maxMatchedLanes = 0; + for (int i = 0; i < lanes.length; i++) { + int matchedLanes = 0; + for (int j = 0; j < nextSegment.getTurnType().getLanes().length - i; j++) { + if (TurnType.getPrimaryTurn(nextSegment.getTurnType().getLanes()[j]) + == TurnType.getPrimaryTurn(currentSegment.getTurnType().getLanes()[i + j])) { + matchedLanes++; + } else { + break; + } + } + if (matchedLanes > maxMatchedLanes) { + matchingIndex = i; + maxMatchedLanes = matchedLanes; + } + } + if (maxMatchedLanes <= 1) { + return; + } + + // Copy the allowed bit from the next segment's lanes to the current segment's matching lanes + for (int i = matchingIndex; i - matchingIndex < nextSegment.getTurnType().getLanes().length; i++) { + lanes[i] |= nextSegment.getTurnType().getLanes()[i - matchingIndex] & 1; + } + currentSegment.getTurnType().setLanes(lanes); + currentSegment.setTurnType(inferTurnFromLanes(currentSegment.getTurnType(), leftSide)); + } } private static final int MAX_SPEAK_PRIORITY = 5; @@ -566,6 +636,7 @@ public class RouteResultPreparation { int right = 0; boolean speak = false; int speakPriority = Math.max(highwaySpeakPriority(prevSegm.getObject().getHighway()), highwaySpeakPriority(currentSegm.getObject().getHighway())); + boolean otherRoutesExist = false; if (attachedRoutes != null) { for (RouteSegmentResult attached : attachedRoutes) { double ex = MapUtils.degreesDiff(attached.getBearingBegin(), currentSegm.getBearingBegin()); @@ -596,6 +667,9 @@ public class RouteResultPreparation { left += lns; } speak = speak || rsSpeakPriority <= speakPriority; + } else if (mpi >= TURN_DEGREE_MIN) { + // Indicate that there are other turns at this intersection, and displaying the lanes may be helpful here. + otherRoutesExist = true; } } } @@ -631,13 +705,40 @@ public class RouteResultPreparation { double devation = Math.abs(MapUtils.degreesDiff(prevSegm.getBearingEnd(), currentSegm.getBearingBegin())); boolean makeSlightTurn = devation > 5 && (!isMotorway(prevSegm) || !isMotorway(currentSegm)); - if (kl) { + if (kl && kr) { + t = TurnType.valueOf(TurnType.C, leftSide); + t.setSkipToSpeak(!speak); + } else if (kl) { t = TurnType.valueOf(makeSlightTurn ? TurnType.TSLL : TurnType.KL, leftSide); t.setSkipToSpeak(!speak); - } - if (kr) { + } else if (kr) { t = TurnType.valueOf(makeSlightTurn ? TurnType.TSLR : TurnType.KR, leftSide); t.setSkipToSpeak(!speak); + } else if (otherRoutesExist && getTurnLanesString(prevSegm) != null) { + // Maybe going straight at a 90-degree intersection + t = TurnType.valueOf(TurnType.C, leftSide); + t.setSkipToSpeak(true); + + // When going straight, the lanes have to be calculated from the previous segment, not the current/next segment. + int prevLanes = prevSegm.getObject().getLanes(); + if (prevSegm.getObject().getOneway() == 0) { + prevLanes = countLanes(prevSegm, prevLanes); + } + if (prevLanes <= 0) { + prevLanes = 1; + } + + t.setLanes(new int[prevLanes]); + t = attachTurnLanesData(leftSide, prevSegm, t); + + // Manually set the allowed lanes based on the turn type + for (int i = 0; i < t.getLanes().length; i++) { + if (TurnType.getPrimaryTurn(t.getLanes()[i]) == TurnType.C) { + t.getLanes()[i] |= 1; + } + } + + return t; } if (t != null && lanes != null) { t.setLanes(lanes); From 984dc80e58e909e048bfbbe010adabfaa74e4116 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Wed, 19 Nov 2014 16:02:35 -0500 Subject: [PATCH 02/12] Make a fix to ensure the directional lane is used --- OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 6646935eb8..ea1e7d1180 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -775,6 +775,9 @@ public class RouteResultPreparation { private TurnType attachTurnLanesData(boolean leftSide, RouteSegmentResult prevSegm, TurnType t) { int lanes = prevSegm.getObject().getLanes(); + if (prevSegm.getObject().getOneway() == 0) { + lanes = countLanes(prevSegm, lanes); + } String turnLanes = getTurnLanesString(prevSegm); if (turnLanes == null) { From 534d11d5443e2641e327455d1164c214957b9b59 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Sun, 23 Nov 2014 11:41:07 -0500 Subject: [PATCH 03/12] Update method call to reflect new parameters. --- .../src/net/osmand/router/RouteResultPreparation.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index bb2617b2d6..41d8aea109 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -708,10 +708,7 @@ public class RouteResultPreparation { t.setSkipToSpeak(true); // When going straight, the lanes have to be calculated from the previous segment, not the current/next segment. - int prevLanes = prevSegm.getObject().getLanes(); - if (prevSegm.getObject().getOneway() == 0) { - prevLanes = countLanes(prevSegm, prevLanes); - } + int prevLanes = countLanes(prevSegm); if (prevLanes <= 0) { prevLanes = 1; } From 1ebad93158441c47ba7f83dad56bcb4c1705e553 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Sun, 23 Nov 2014 13:28:21 -0500 Subject: [PATCH 04/12] Split determining which turns to merge into a separate function --- OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 41d8aea109..19963392d9 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -390,6 +390,10 @@ public class RouteResultPreparation { } } + determineTurnsToMerge(leftside, result); + } + + private void determineTurnsToMerge(boolean leftside, List result) { for (int i = result.size() - 2; i >= 0; i--) { RouteSegmentResult currentSegment = result.get(i); RouteSegmentResult nextSegment = null; From 2b9c96966ef90ab009804527786175402cac2d47 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 24 Nov 2014 20:24:47 -0500 Subject: [PATCH 05/12] Update to call new methods. --- .../router/.RouteResultPreparation.java.swp | Bin 0 -> 57344 bytes .../osmand/router/RouteResultPreparation.java | 16 +++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 OsmAnd-java/src/net/osmand/router/.RouteResultPreparation.java.swp diff --git a/OsmAnd-java/src/net/osmand/router/.RouteResultPreparation.java.swp b/OsmAnd-java/src/net/osmand/router/.RouteResultPreparation.java.swp new file mode 100644 index 0000000000000000000000000000000000000000..3e3bfac96ffe10af9db6f6f4baf586a946dee4f8 GIT binary patch literal 57344 zcmeI53wT{ub>|gI0r4nJAkab!$6}gX`Eg}CBqXt&#Bm(rVq5+snLwSOxz;_Bu61>< za_^NNam;h3g>Rs|%PSC`0SYArN`WDCpbRbL(Ly268K4w~7N#(zq@_?O)A{|^-ut}n zxw1?WzRp+q`~H@6&VH`F_S$Q$z4ktbH$QRDzUXn)#}4uD=ZA)N-_e~qwBZp$&uN2T>!OF8bMW6YMb`ShMu9a7tWjW%0&5glqre&k)+n$>fq!=t z=q){P=xOx&UcTou{^wbRpAYbVKgs{B7v4Y6|NUhD^Y+5~2l>CR_dn0|6@+^3Mu9a7tWjW%0&5glqre&k)+n$>fi()OQDBV%YZSOg zC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>Z@AzWD=b{DxfL{+c6Pb`FOP+B4YtO2ejw^SJ?TV1h;@CuoG+o ze~)ed4)7B2bg&)_fiGg~{}H$yyc;O?|Hs(;cL3er_df7u&;f@)1;`(82Y3Sz{a+4} zf0~E-=O(-TDkDpAG8V1H_R4ZRKAT4POdaIHn{=jI4s$QLPt9z#HOii5m1?^cA}Mrg zLaJg<*(7G&4R=23%CfHJOWS5;czLrzE2K#D?4p#kdO|Z-tX_GR6Ne>*r_@;%brJ)| zHjZ}wY3w7PVsA=?$( za#Z2@yJlPxTW%;+ZR8U{sZW?^L3y)2rS_>yY&kAy`Se;(bJUz2dle?A?94lJ5)4}@uP~d2|1-6Ajdg1z_w5dJqw}!&2em1G^ekS=j z72X#}hcCw|gf(3%p`?8nf0@3R?oNB2Opaa-gn4nu02M~RKuSC*R?Y8E=Fs zn`0LnBV1PgP=Zg2qkOR0RIp~YkICQa2gpX=4gbKBp;wR~+JaXj``hpQ&;E6x58gSA z+V5MPehh2Wd&?4ItK3BlLw21u&T$U8d{g(d{xa7z%cOocpY+KKPQij)xmz;U?i`G@ z*Cs}$S!Q3@8!kgDYpoXm{>N}h<6Y2so){LG)lCP}6DNq*+(#luOFLw%=StZMvv|0yX+4&| z=~`wCryV3gSg6c)Hh2lctz6XiCMgSyAU796feZ(&%W;7zVF!C&sf7zn;)s8n7 zmlwHXDK*_)(#MuI`t$wMqqLnXPts1$#oLxl`m8ghobn~j8C;z2 zkNidh2GZ%-S1vc2M3H4rqPfEcx!1u(;is@sfor-(A{UVu&q@dreP}v>pLVlFPRwQ| uZzi#$s?%BhiW;`|I+R^HuoLlYXqC4Z{MeN6(|(4?CpJZ_d^O8$Uj09q)TUJc literal 0 HcmV?d00001 diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 102aa43177..8a018d6ef5 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -462,8 +462,15 @@ public class RouteResultPreparation { for (int i = matchingIndex; i - matchingIndex < nextSegment.getTurnType().getLanes().length; i++) { lanes[i] |= nextSegment.getTurnType().getLanes()[i - matchingIndex] & 1; } - currentSegment.getTurnType().setLanes(lanes); - currentSegment.setTurnType(inferTurnFromLanes(currentSegment.getTurnType(), leftSide)); + TurnType t = currentSegment.getTurnType(); + t.setLanes(lanes); + int turn = inferTurnFromLanes(lanes); + if (turn != 0 && turn != t.getValue()) { + TurnType newTurnType = TurnType.valueOf(turn, leftSide); + newTurnType.setLanes(lanes); + newTurnType.setSkipToSpeak(t.isSkipToSpeak()); + currentSegment.setTurnType(newTurnType); + } } } @@ -696,13 +703,12 @@ public class RouteResultPreparation { t.setSkipToSpeak(true); // When going straight, the lanes have to be calculated from the previous segment, not the current/next segment. - int prevLanes = countLanes(prevSegm); + int prevLanes = countLanesMinOne(prevSegm); if (prevLanes <= 0) { prevLanes = 1; } - t.setLanes(new int[prevLanes]); - t = attachTurnLanesData(leftSide, prevSegm, t); + t.setLanes(attachTurnLanesData(prevSegm, new int[prevLanes])); // Manually set the allowed lanes based on the turn type for (int i = 0; i < t.getLanes().length; i++) { From e4a2b38ea47c6021a7ae94a303ddbd7ae4fd5159 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Fri, 28 Nov 2014 08:19:23 -0600 Subject: [PATCH 06/12] Remove vim file --- .../router/.RouteResultPreparation.java.swp | Bin 57344 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 OsmAnd-java/src/net/osmand/router/.RouteResultPreparation.java.swp diff --git a/OsmAnd-java/src/net/osmand/router/.RouteResultPreparation.java.swp b/OsmAnd-java/src/net/osmand/router/.RouteResultPreparation.java.swp deleted file mode 100644 index 3e3bfac96ffe10af9db6f6f4baf586a946dee4f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57344 zcmeI53wT{ub>|gI0r4nJAkab!$6}gX`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XPts1$#oLxl`m8ghobn~j8C;z2 zkNidh2GZ%-S1vc2M3H4rqPfEcx!1u(;is@sfor-(A{UVu&q@dreP}v>pLVlFPRwQ| uZzi#$s?%BhiW;`|I+R^HuoLlYXqC4Z{MeN6(|(4?CpJZ_d^O8$Uj09q)TUJc From cefabcf5208837ea70b767539ac5e1d8743e4ce7 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Fri, 28 Nov 2014 08:39:18 -0600 Subject: [PATCH 07/12] Make local variables to shorten lines. --- .../osmand/router/RouteResultPreparation.java | 41 +++++++++---------- .../src/net/osmand/router/TurnType.java | 6 ++- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 8a018d6ef5..83fb8c3fc5 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -409,31 +409,31 @@ public class RouteResultPreparation { } } - if (currentSegment.getTurnType() == null || currentSegment.getTurnType().getLanes() == null - || nextSegment == null) { + TurnType currentTurn = currentSegment.getTurnType(); + TurnType nextTurn = nextSegment.getTurnType(); + + if (currentTurn == null || currentTurn.getLanes() == null || nextTurn == null || nextTurn.getLanes() == null) { continue; } // Only allow slight turns that are nearby to be merged. - if (currentSegment.getDistance() < 60 && nextSegment.getTurnType().getLanes().length <= currentSegment.getTurnType().getLanes().length - && (currentSegment.getTurnType().getValue() == TurnType.C - || currentSegment.getTurnType().getValue() == TurnType.TSLL - || currentSegment.getTurnType().getValue() == TurnType.TSLR - || currentSegment.getTurnType().getValue() == TurnType.KL - || currentSegment.getTurnType().getValue() == TurnType.KR)) { + if (currentSegment.getDistance() < 60 && nextTurn.getLanes().length <= currentTurn.getLanes().length + && TurnType.isSlightTurn(currentTurn.getValue())) { mergeTurnLanes(leftside, currentSegment, nextSegment); } } } private void mergeTurnLanes(boolean leftSide, RouteSegmentResult currentSegment, RouteSegmentResult nextSegment) { - boolean isUsingTurnLanes = TurnType.getPrimaryTurn(currentSegment.getTurnType().getLanes()[0]) != 0 - && TurnType.getPrimaryTurn(nextSegment.getTurnType().getLanes()[0]) != 0; + TurnType currentTurn = currentSegment.getTurnType(); + TurnType nextTurn = nextSegment.getTurnType(); + boolean isUsingTurnLanes = TurnType.getPrimaryTurn(currentTurn.getLanes()[0]) != 0 + && TurnType.getPrimaryTurn(nextTurn.getLanes()[0]) != 0; if (isUsingTurnLanes) { - int[] lanes = new int[currentSegment.getTurnType().getLanes().length]; + int[] lanes = new int[currentTurn.getLanes().length]; // Unset the allowed lane bit for (int i = 0; i < lanes.length; i++) { - lanes[i] = currentSegment.getTurnType().getLanes()[i] & ~1; + lanes[i] = currentTurn.getLanes()[i] & ~1; } // Find the first lane that matches (based on the turn being taken), and how many lanes match @@ -441,9 +441,9 @@ public class RouteResultPreparation { int maxMatchedLanes = 0; for (int i = 0; i < lanes.length; i++) { int matchedLanes = 0; - for (int j = 0; j < nextSegment.getTurnType().getLanes().length - i; j++) { - if (TurnType.getPrimaryTurn(nextSegment.getTurnType().getLanes()[j]) - == TurnType.getPrimaryTurn(currentSegment.getTurnType().getLanes()[i + j])) { + for (int j = 0; j < nextTurn.getLanes().length - i; j++) { + if (TurnType.getPrimaryTurn(nextTurn.getLanes()[j]) + == TurnType.getPrimaryTurn(currentTurn.getLanes()[i + j])) { matchedLanes++; } else { break; @@ -459,16 +459,15 @@ public class RouteResultPreparation { } // Copy the allowed bit from the next segment's lanes to the current segment's matching lanes - for (int i = matchingIndex; i - matchingIndex < nextSegment.getTurnType().getLanes().length; i++) { - lanes[i] |= nextSegment.getTurnType().getLanes()[i - matchingIndex] & 1; + for (int i = matchingIndex; i - matchingIndex < nextTurn.getLanes().length; i++) { + lanes[i] |= nextTurn.getLanes()[i - matchingIndex] & 1; } - TurnType t = currentSegment.getTurnType(); - t.setLanes(lanes); + currentTurn.setLanes(lanes); int turn = inferTurnFromLanes(lanes); - if (turn != 0 && turn != t.getValue()) { + if (turn != 0 && turn != currentTurn.getValue()) { TurnType newTurnType = TurnType.valueOf(turn, leftSide); newTurnType.setLanes(lanes); - newTurnType.setSkipToSpeak(t.isSkipToSpeak()); + newTurnType.setSkipToSpeak(currentTurn.isSkipToSpeak()); currentSegment.setTurnType(newTurnType); } } diff --git a/OsmAnd-java/src/net/osmand/router/TurnType.java b/OsmAnd-java/src/net/osmand/router/TurnType.java index 85be5bc5bb..04f982045e 100644 --- a/OsmAnd-java/src/net/osmand/router/TurnType.java +++ b/OsmAnd-java/src/net/osmand/router/TurnType.java @@ -253,4 +253,8 @@ public class TurnType { public static boolean isRightTurn(int type) { return type == TR || type == TSHR || type == TSLR; } -} \ No newline at end of file + + public static boolean isSlightTurn(int type) { + return !isLeftTurn(type) && !isRightTurn(type) && type != TU && type != TRU && type != OFFR; + } +} From d527eb4fe9efd67c962c727259d458d04affd754 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Thu, 4 Dec 2014 22:51:18 -0500 Subject: [PATCH 08/12] Fix slight turn definition, and remove redundant lines --- OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java | 3 --- OsmAnd-java/src/net/osmand/router/TurnType.java | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 83fb8c3fc5..6fcefc641b 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -703,9 +703,6 @@ public class RouteResultPreparation { // When going straight, the lanes have to be calculated from the previous segment, not the current/next segment. int prevLanes = countLanesMinOne(prevSegm); - if (prevLanes <= 0) { - prevLanes = 1; - } t.setLanes(attachTurnLanesData(prevSegm, new int[prevLanes])); diff --git a/OsmAnd-java/src/net/osmand/router/TurnType.java b/OsmAnd-java/src/net/osmand/router/TurnType.java index 04f982045e..8884c64ede 100644 --- a/OsmAnd-java/src/net/osmand/router/TurnType.java +++ b/OsmAnd-java/src/net/osmand/router/TurnType.java @@ -255,6 +255,6 @@ public class TurnType { } public static boolean isSlightTurn(int type) { - return !isLeftTurn(type) && !isRightTurn(type) && type != TU && type != TRU && type != OFFR; + return type == TSLL || type == TSLR || type == C || type == KL || type == KR; } } From 08dc488850d5c9b296b88e68f62f36c87d19ddf4 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Fri, 5 Dec 2014 23:00:12 -0500 Subject: [PATCH 09/12] Fix NullPointerException that occurs if there are no more turns with lanes indicated. --- OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 6fcefc641b..316200a4d5 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -409,6 +409,10 @@ public class RouteResultPreparation { } } + if (nextSegment == null) { + continue; + } + TurnType currentTurn = currentSegment.getTurnType(); TurnType nextTurn = nextSegment.getTurnType(); From f6935327825c1da8f5e67e50863e841090eb82ea Mon Sep 17 00:00:00 2001 From: User99gmxat Date: Sat, 6 Dec 2014 13:55:04 +0100 Subject: [PATCH 10/12] Update phrases.xml --- OsmAnd/res/values-de/phrases.xml | 81 +++++++++++++++++--------------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index 570ef9ccee..a14b3a6d9d 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -13,12 +13,12 @@ Güterseilbahn Schlepplift Teppichlift - Hybrid-Lift + Hybridlift Plattenlift Übungslift Seilbahnstation Schlepplift - Flughafen-Gate + Flughafengate Flughafenterminal Landmaschinen Flughafen @@ -43,7 +43,7 @@ Babyartikel Babyklappe Taschen - Bailiff + Gerichtsvollzieher Bäckerei Bank Bar @@ -129,15 +129,15 @@ Sozialkaufhaus Schach Kino - Computergeschäft - Folkloreverein + Computer-Klub + Folklore Fanklub Fischklub Spielklub Geschichtsklub Jagdtverein - Linux club - Motorradgeschäft + Linux Klub + Motorrad Musikladen Naturverein Fotographieklub @@ -151,7 +151,7 @@ Gemeindezentrum Firma Druckluft - Rechenzentrum + Computer Computer-Geschäft Süßwaren Anlage @@ -204,7 +204,7 @@ Feuerwehr Löschteich Erste Hilfe - Fischereiplatz + Fischen Angelzeug Fjord Blumenhandlung @@ -220,7 +220,7 @@ Garage Gartencenter Gärtner - Flüssiggasgeschäft + Flüssiggas Tor Gemischtwarenhandlung Geisir @@ -279,13 +279,13 @@ Kindergarten Kiosk Küchengeräte - Korfbal + Korfball Mülldeponie - Wäscherei + Wäscherei Rechtsanwalt Sportbahn Bücherei - Hebetür + Schranken Leuchtturm Lokalität Schleusentor @@ -304,14 +304,14 @@ Bunker Gefahrenbereich Marinestützpunkt - Atombombenexplosiongebiet + Atombombenexplosionsgebiet Militärbereich Historisches Bergwerk Mineshaft Minigolf Handy-Geschäft Kloster - Pfandleiher + Pfandleiher Denkmal Leichenhalle Motel @@ -364,14 +364,14 @@ Kleingartensiedlung Farm Kultstätte - Kultstätte: Buddhistischh - Kultstätte: Christlich - Kultstätte: Hinduistisch - Kultstätte: Jüdisch - Kultstätte: Muslimisch - Kultstätte: Shintoistisch - Kultstätte: Sikh - Kultstätte: Taoistisch + Buddhistische Kultstätte + Christliche Kultstätte + Hinduistische Kultstätte + Jüdische Kultstätte + Muslimische Kultstätte + Shintoistische Kultstätte + Sikh Kultstätte + Taoistische Kultstätte Plasterer Spielplatz Installateur @@ -388,11 +388,11 @@ Staatsanwalt Psychotherapeut Kneipe - Öffentlicher Personennahverkehr + Öff. Personennahverkehr Bushaltestelle Straßenbahnhaltestelle Oberleitungsbushaltestelle - Öffentliches Verkehrsmittel + Öff. Verkehrsmittel-Station Steinbruch Gerinne Schläger @@ -436,19 +436,19 @@ Leuchtturm Hauptleuchtturm Nebenleuchtturm - Wassergeschützer Leuchtturm + Sicheres Gewässer-Leuchtturm Sonderleuchtturm - Ankerplatz + Ankerplatz Seezeichenbrücke Seegebäude Hauptboje Installationsboje - Boje, isolaierte Gefahr + Boje, isolierte Gefahr Nebenboje - Sicherswasserboje + Sicheres Gewässer-Boje Sonderboje Tagzeichen - Entfernungsmarke + Entfernungsmarke Trockendock Damm Schwimmdock @@ -462,16 +462,16 @@ Nebenleuchtseezeichen Schiffsleuchtseezeichen Ankerplatz - Hinweis, Seezeichenk + Hinweis Pfahl - Radarantwortbake - Funkstation, Seezeichen - Felsen, Seezeichen - Signalstelle, Verkehr - Signalstelle, Warnung + Radarsender + Funkstation + Felsen + Signalstelle: Verkehr + Signalstelle: Warnung Sportbooteinrichtung - Baken, Seezeichen - Wrsck, Seezeichen + Baken + Wrack Gebrauchtwaren Reifenhändler SES-Station @@ -588,4 +588,9 @@ Anlage Schiffswrack Zoo + Amerik. Football + Base-Jumping + BMX + Kanad. Football + Surfen From 26c3696fb2b5f07d84b289fea43eb29c0aac5bbb Mon Sep 17 00:00:00 2001 From: User99gmxat Date: Sat, 6 Dec 2014 13:55:30 +0100 Subject: [PATCH 11/12] Update strings.xml --- OsmAnd/res/values-de/strings.xml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index e3f177ae4c..82342918f6 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -1,4 +1,4 @@ - + Geschwindigkeitsbegrenzung Grenzkontrolle @@ -290,7 +290,7 @@ Offline-Bearbeitung Immer Offline-Bearbeitung verwenden Das Bearbeiten von POIs innerhalb von OsmAnd beeinflusst nicht die Offline-Karten, sondern wird in einer eigenen Datei gespeichert. - hochladen… + Hochladen… {0} POI/Bugs wurden hochgeladen Alle hochladen @@ -625,7 +625,7 @@ Route speichern GPX Dateien an OSM-Gemeinschaft übermitteln. Die Dateien können dort zur Kartenverbesserung verwendet werden. %1$d von %2$d Datei(en) erfolgreich hochgeladen. - Senden an OSM + An OSM senden Mehr Kartendetails Einige Vektor-Daten (Straßen etc.) bereits bei kleineren Vergrößerungen zeigen Favorit(en) erfolgreich gelöscht. @@ -776,7 +776,7 @@ Historisches Landnutzung Freizeit - von Menschenhand + Von Menschenhand Militär Natur Büro @@ -848,8 +848,8 @@ Fehler aufgetreten: Renderer wurde nicht geladen Vektor-Renderer Wähle Anzeigemodus für Offline-Vektor-Karten - Zeige POI-Internetseite - Zeige POI-Telefon + POI-Internetseite anzeigen + POI-Telefon anzeigen Internetseite Telefon Filtern nach Typ @@ -968,8 +968,8 @@ Streckenlänge Öffentlicher Personenverkehr OK - Zeige öffentliche Haltestellen auf der Karte - Zeige Haltestellen + Öffentl. Haltestellen auf der Karte anzeigen + Haltestellen anzeigen Navigationsanwendung OsmAnd POI-Daten wurden erfolgreich aktualisiert ({0} wurden geladen) Fehler beim aktualisieren der Offline-Daten @@ -1896,7 +1896,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Nutzer %1$s hat die Gruppe %2$s betreten Nutzer %1$s hat die Gruppe %2$s verlassen Gruppenbenachrichtigungen anzeigen - Zeige Pop-up-Meldung, wenn eine Nutzer der Gruppe beitritt oder sie verlässt + Pop-up-Meldung, wenn eine Nutzer der Gruppe beitritt oder sie verlässt anzeigen Um eine Verbindung zum Gerät %2$s herzustellen, bitte den Link %3$s antippen oder die Tracker-ID (%1$s) angeben Anmeldung fehlgeschlagen Fehler bei der OsMo-Anmeldung: %1$s.\n Möglicherweise ist der Dienst nicht verfügbar oder Ihre Anmeldung ist abgelaufen.\n Fortsetzen mit einer neuen Registrierung? @@ -2023,4 +2023,10 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Alles ist aktuell OpenGL-Renderung verwenden Hardware beschleunigte OpenGL-Renderung verwenden (Funktioniert nicht auf allen Geräten) + Herunterladen nicht möglich. Zum Fortsetzen mit WLAN verbinden! + Heruntergeladen + Aktualisierungen + Lokal + Bildschirm aktivieren + Bei Annäherung einer Richtungsänderung den Bildschirm einschalten From 5a6b3235b64d56a3c98f08fd88e996358ef1b1e4 Mon Sep 17 00:00:00 2001 From: Thomas Tonino Date: Sat, 6 Dec 2014 23:03:23 +0100 Subject: [PATCH 12/12] Translated using Weblate (Dutch) Currently translated at 100.0% (1576 of 1576 strings) http://nl.wikipedia.org/wiki/Oostwaarde_en_noordwaarde --- OsmAnd/res/values-nl/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index 5ff081e631..3274a85864 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -2023,4 +2023,5 @@ Afghanistan, Albanie, Algerije, Andorra, Angola, Anguilla, Antigua en Barbuda, A In de omgeving Oostwaarde Noordwaarde + Zone