From b4dfcbd5459af92bf762c69481d36e939ce550b8 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Sun, 23 Nov 2014 17:41:36 +0100 Subject: [PATCH 01/14] Translated using Weblate (Danish) Currently translated at 100.0% (1562 of 1562 strings) --- OsmAnd/res/values-da/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 21bd8a59d3..3b4dcd35ba 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -1860,4 +1860,6 @@ Nogle af de centrale funktioner: %1$s behøver denne tilladelse til at slukke for skærmen for strømbesparende funktion. Aldrig Avanceret + Brug sikker forbindelse med server + Brug https From 6106f8a1fe56e3be76add215e054c9182a20bfa7 Mon Sep 17 00:00:00 2001 From: Jur Kis Date: Sun, 23 Nov 2014 18:28:24 +0100 Subject: [PATCH 02/14] Translated using Weblate (Lithuanian) Currently translated at 100.0% (1562 of 1562 strings) --- OsmAnd/res/values-lt/strings.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-lt/strings.xml b/OsmAnd/res/values-lt/strings.xml index 4941a05c95..c4908691f3 100644 --- a/OsmAnd/res/values-lt/strings.xml +++ b/OsmAnd/res/values-lt/strings.xml @@ -1878,4 +1878,7 @@ OsmAnd yra aktyviai tobulinama ir mūsų projektas bei jo tolesnis progresas pri Įjungti ekraną artėjant prie posūkio %1$s prašo leidimo išjungti ekraną tausojant energiją. Niekada - + Naudoti https + Prie serverio jungtis saugiu ryšiu + Plačiau + From 8cc445b55654901c373f84eda611c88b0de10407 Mon Sep 17 00:00:00 2001 From: Viktar Palstsiuk Date: Sun, 23 Nov 2014 18:57:55 +0100 Subject: [PATCH 03/14] Translated using Weblate (Belarusian) Currently translated at 100.0% (1562 of 1562 strings) --- OsmAnd/res/values-be/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index 5c2809841f..5fbf245046 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -1999,4 +1999,6 @@ OsmAnd мае адкрыты зыходны код і актыўна разві Ніколі %1$s патрабуе дазвол на выключэньне экрану для энергазберажэньня. Дадатковыя + Выкарыстоўваць бясьпечнае злучэньне з серверам + Выкарыстоўваць HTTPS From 3aa50db405dee3e28f61c8660777ce5a04ddfef3 Mon Sep 17 00:00:00 2001 From: Roberto GEB Date: Sun, 23 Nov 2014 19:19:45 +0100 Subject: [PATCH 04/14] Translated using Weblate (Spanish) Currently translated at 100.0% (1562 of 1562 strings) --- OsmAnd/res/values-es/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index 09b937d14e..728641672b 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -1919,4 +1919,6 @@ Afganistán, Albania, Alemania, Andorra, Angola, Anguila, Antigua y Barbuda, Ant %1$s necesita este permiso para apagar la pantalla para la característica de ahorro energético. Nunca Avanzado + Usar conexión segura con el servidor + Usar https From a9b1031ce9ae9010002ab63d3ac45fecaa944e4c Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 23 Nov 2014 19:45:31 +0100 Subject: [PATCH 05/14] Fix issue with turn type --- .../osmand/router/RouteResultPreparation.java | 333 ++++++++---------- .../src/net/osmand/router/TurnType.java | 16 + 2 files changed, 165 insertions(+), 184 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 2fd6711a36..74c08ed287 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -1,16 +1,16 @@ package net.osmand.router; +import gnu.trove.list.array.TIntArrayList; +import gnu.trove.set.hash.TIntHashSet; + import java.io.IOException; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashSet; import java.util.Iterator; import java.util.List; -import org.apache.commons.logging.Log; - import net.osmand.PlatformUtil; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteTypeRule; @@ -21,6 +21,8 @@ import net.osmand.router.BinaryRoutePlanner.RouteSegment; import net.osmand.router.RoutePlannerFrontEnd.RouteCalculationMode; import net.osmand.util.MapUtils; +import org.apache.commons.logging.Log; + public class RouteResultPreparation { public static boolean PRINT_TO_CONSOLE_ROUTE_INFORMATION_TO_TEST = false; @@ -440,7 +442,10 @@ public class RouteResultPreparation { } else { t = TurnType.valueOf(TurnType.TU, leftSide); } - assignLanesInfo(prev, t, leftSide); + int[] lanes = getTurnLanesInfo(prev, t.getValue(), leftSide, true); + if(lanes != null) { + t.setLanes(lanes); + } } else if (mpi < -TURN_DEGREE_MIN) { if (mpi > -60) { t = TurnType.valueOf(TurnType.TSLR, leftSide); @@ -451,7 +456,10 @@ public class RouteResultPreparation { } else { t = TurnType.valueOf(TurnType.TU, leftSide); } - assignLanesInfo(prev, t, leftSide); + int[] lanes = getTurnLanesInfo(prev, t.getValue(), leftSide, false); + if(lanes != null) { + t.setLanes(lanes); + } } else { t = attachKeepLeftInfoAndLanes(leftSide, prev, rr, t); } @@ -462,62 +470,52 @@ public class RouteResultPreparation { return t; } - private void assignLanesInfo(RouteSegmentResult prevSegm, TurnType t, boolean leftSide) { - int lanes = prevSegm.getObject().getLanes(); - if (prevSegm.getObject().getOneway() == 0) { - lanes = countLanes(prevSegm, lanes); - } - if (lanes <= 0) { - return; - } - + private int[] getTurnLanesInfo(RouteSegmentResult prevSegm, int mainTurnType, boolean leftSide, + boolean leftTurn) { String turnLanes = getTurnLanesString(prevSegm); if (turnLanes == null) { - return; + return null; } - String[] splitLaneOptions = turnLanes.split("\\|", -1); - if (splitLaneOptions.length != lanes) { + if (splitLaneOptions.length != countLanesMinOne(prevSegm)) { // Error in data or missing data - return; + return null; } - - int[] lanesArray = new int[lanes]; - t.setLanes(lanesArray); - assignTurns(splitLaneOptions, t); - - // In some cases (at least in the US), the rightmost lane might not have a right turn indicated as per turn:lanes, but is allowed and being used here. This section adds in that indicator. The same applies for where leftSide is true. - if (leftSide) { - if (t.getValue() == TurnType.TL - && TurnType.getPrimaryTurn(lanesArray[0]) != TurnType.TL - && TurnType.getPrimaryTurn(lanesArray[0]) != TurnType.TSLL - && TurnType.getPrimaryTurn(lanesArray[0]) != TurnType.TSHL) { - if (TurnType.getPrimaryTurn(lanesArray[0]) != 0) { - // This was just to make sure that there's no bad data. - t.setSecondaryTurn(0, TurnType.getPrimaryTurn(lanesArray[0])); - t.setPrimaryTurn(0, TurnType.TL); - } - } - } else { - int lastIndex = lanesArray.length - 1; - if (t.getValue() == TurnType.TR - && TurnType.getPrimaryTurn(lanesArray[lastIndex]) != TurnType.TR - && TurnType.getPrimaryTurn(lanesArray[lastIndex]) != TurnType.TSLR - && TurnType.getPrimaryTurn(lanesArray[lastIndex]) != TurnType.TSHR) { - if (TurnType.getPrimaryTurn(lanesArray[lastIndex]) != 0) { - // This was just to make sure that there's no bad data. - t.setSecondaryTurn(lastIndex, TurnType.getPrimaryTurn(lanesArray[lastIndex])); - t.setPrimaryTurn(lastIndex, TurnType.TR); - } - } - } - + int[] lanesArray = calculateRawTurnLanes(splitLaneOptions, mainTurnType); // Manually set the allowed lanes. + boolean isSet = setAllowedLanes(mainTurnType, lanesArray); + if(!isSet && lanesArray.length > 0) { + // In some cases (at least in the US), the rightmost lane might not have a right turn indicated as per turn:lanes, + // but is allowed and being used here. This section adds in that indicator. The same applies for where leftSide is true. + int ind = leftTurn? 0 : lanesArray.length - 1; + final int tt = TurnType.getPrimaryTurn(lanesArray[ind]); + if (leftTurn) { + if (!TurnType.isLeftTurn(tt)) { + // This was just to make sure that there's no bad data. + TurnType.setSecondaryTurn(lanesArray, ind, tt); + TurnType.setPrimaryTurn(lanesArray, ind, TurnType.TL); + } + } else { + if (!TurnType.isRightTurn(tt)) { + // This was just to make sure that there's no bad data. + TurnType.setSecondaryTurn(lanesArray, ind, tt); + TurnType.setPrimaryTurn(lanesArray, ind, TurnType.TR); + } + } + setAllowedLanes(lanesArray[ind], lanesArray); + } + return lanesArray; + } + + protected boolean setAllowedLanes(int mainTurnType, int[] lanesArray) { + boolean turnSet = false; for (int i = 0; i < lanesArray.length; i++) { - if (TurnType.getPrimaryTurn(lanesArray[i]) == t.getValue()) { + if (TurnType.getPrimaryTurn(lanesArray[i]) == mainTurnType) { lanesArray[i] |= 1; + turnSet = true; } } + return turnSet; } private TurnType processRoundaboutTurn(List result, int i, boolean leftSide, RouteSegmentResult prev, @@ -554,7 +552,6 @@ public class RouteResultPreparation { private TurnType attachKeepLeftInfoAndLanes(boolean leftSide, RouteSegmentResult prevSegm, RouteSegmentResult currentSegm, TurnType t) { // keep left/right - int[] lanes = null; boolean kl = false; boolean kr = false; List attachedRoutes = currentSegm.getAttachedRoutes(currentSegm.getStartPointIndex()); @@ -574,27 +571,11 @@ public class RouteResultPreparation { if (rsSpeakPriority != MAX_SPEAK_PRIORITY || speakPriority == MAX_SPEAK_PRIORITY) { if ((ex < TURN_DEGREE_MIN || mpi < TURN_DEGREE_MIN) && ex >= 0) { kl = true; - int lns = attached.getObject().getLanes(); - if(attached.getObject().getOneway() == 0) { - lns = countLanes(attached, lns); - } - if (lns <= 0) { - right += 1; - } else { - right += lns; - } + right += countLanesMinOne(attached); speak = speak || rsSpeakPriority <= speakPriority; } else if ((ex > -TURN_DEGREE_MIN || mpi < TURN_DEGREE_MIN) && ex <= 0) { kr = true; - int lns = attached.getObject().getLanes(); - if(attached.getObject().getOneway() == 0) { - lns = countLanes(attached, lns); - } - if (lns <= 0) { - left += 1; - } else { - left += lns; - } + left += countLanesMinOne(attached); speak = speak || rsSpeakPriority <= speakPriority; } } @@ -605,29 +586,20 @@ public class RouteResultPreparation { } else if(kl && right == 0) { right = 1; } - int current = currentSegm.getObject().getLanes(); - // attachedRoutes covers all allowed outbound routes at that point except currentSegm. - if (currentSegm.getObject().getOneway() == 0) { - current = countLanes(currentSegm, current); - } - if (current <= 0) { - current = 1; - } -// if(ls >= 0 /*&& current + left + right >= ls*/){ - lanes = new int[current + left + right]; - ls = current + left + right; - for(int it=0; it< ls; it++) { - if(it < left || it >= left + current) { - lanes[it] = 0; - } else { - lanes[it] = 1; - } + int current = countLanesMinOne(currentSegm); + int[] lanes = new int[current + left + right]; + ls = current + left + right; + for (int it = 0; it < ls; it++) { + if (it < left || it >= left + current) { + lanes[it] = 0; + } else { + lanes[it] = 1; } - // sometimes links are - if ((current <= left + right) && (left > 1 || right > 1)) { - speak = true; - } -// } + } + // sometimes links are + if ((current <= left + right) && (left > 1 || right > 1)) { + speak = true; + } double devation = Math.abs(MapUtils.degreesDiff(prevSegm.getBearingEnd(), currentSegm.getBearingBegin())); boolean makeSlightTurn = devation > 5 && (!isMotorway(prevSegm) || !isMotorway(currentSegm)); @@ -640,14 +612,42 @@ public class RouteResultPreparation { t.setSkipToSpeak(!speak); } if (t != null && lanes != null) { - t.setLanes(lanes); - - t = attachTurnLanesData(leftSide, prevSegm, t); + int[] calcLanes = attachTurnLanesData(prevSegm, lanes); + if(calcLanes != lanes) { + int tp = inferTurnFromLanes(calcLanes); + if (tp != 0 && tp != t.getValue()) { + TurnType derivedTurnType = TurnType.valueOf(tp, leftSide); + derivedTurnType.setLanes(calcLanes); + derivedTurnType.setSkipToSpeak(t.isSkipToSpeak()); + // Because only the primary turn is displayed, if the turn to be taken is currently set as the + // secondary turn, then that needs to be switched around. + for (int i = 0; i < calcLanes.length; i++) { + if (TurnType.getSecondaryTurn(calcLanes[i]) == tp) { + derivedTurnType.setSecondaryTurn(i, TurnType.getPrimaryTurn(calcLanes[i])); + derivedTurnType.setPrimaryTurn(i, tp); + } + } + } + } + t.setLanes(calcLanes); + } return t; } - protected int countLanes(RouteSegmentResult attached, int lns) { + + protected int countLanesMinOne(RouteSegmentResult attached) { + final boolean oneway = attached.getObject().getOneway() != 0; + int lns = attached.getObject().getLanes(); + if(lns == 0) { + String tls = getTurnLanesString(attached); + if(tls != null) { + lns = countOccurrences(tls, '|'); + } + } + if (oneway) { + return Math.max(1, lns); + } try { if (attached.isForwardDirection() && attached.getObject().getValue("lanes:forward") != null) { return Integer.parseInt(attached.getObject().getValue("lanes:forward")); @@ -657,7 +657,7 @@ public class RouteResultPreparation { } catch (NumberFormatException e) { e.printStackTrace(); } - return (lns + 1) / 2; + return Math.max(1, (lns + 1) / 2); } protected String getTurnLanesString(RouteSegmentResult segment) { @@ -672,64 +672,44 @@ public class RouteResultPreparation { } } - private TurnType attachTurnLanesData(boolean leftSide, RouteSegmentResult prevSegm, TurnType t) { - int lanes = prevSegm.getObject().getLanes(); + private int[] attachTurnLanesData(RouteSegmentResult prevSegm, int[] outgoingCalcLanes) { String turnLanes = getTurnLanesString(prevSegm); - if (turnLanes == null) { - return t; + return outgoingCalcLanes; } - String[] splitLaneOptions = turnLanes.split("\\|", -1); - if (splitLaneOptions.length != lanes) { + if (splitLaneOptions.length != countLanesMinOne(prevSegm)) { // Error in data or missing data - return t; + return outgoingCalcLanes; } + int[] usableLanes = mergeOutgoingLanesUsingTurnLanes(outgoingCalcLanes, splitLaneOptions); + int[] rawLanes = calculateRawTurnLanes(splitLaneOptions, 0); + for(int k = 0 ; k < splitLaneOptions.length; k++) { + if((usableLanes[k] & 1) != 0) { + rawLanes[k] |= 1; + } + } + return rawLanes; + } - if (t.getLanes().length != lanes) { + protected int[] mergeOutgoingLanesUsingTurnLanes(int[] outgoingCalcLanes, String[] splitLaneOptions) { + int[] usableLanes = outgoingCalcLanes; + if (outgoingCalcLanes.length != splitLaneOptions.length) { + usableLanes = new int[splitLaneOptions.length]; // The turn:lanes don't easily match up to the target road. - List sourceLanes = new ArrayList(); - int outgoingLanesIndex = 0; int sourceLanesIndex = 0; - - while (outgoingLanesIndex < t.getLanes().length && sourceLanesIndex < lanes) { - if (splitLaneOptions[sourceLanesIndex].contains(";")) { - // Two or more allowed turns for this lane - int options = countOccurrences(splitLaneOptions[sourceLanesIndex], ';'); - if (options == 1) { - if (outgoingLanesIndex + 1 >= t.getLanes().length) { - // Likely an error in data - return t; - } - int usability = t.getLanes()[outgoingLanesIndex] | t.getLanes()[outgoingLanesIndex + 1]; - sourceLanes.add(usability); - outgoingLanesIndex += 2; - sourceLanesIndex++; - } else { - // Not supported - return t; - } - } else { - // Only one allowed turn; behave normally - sourceLanes.add(t.getLanes()[outgoingLanesIndex]); + while (outgoingLanesIndex < outgoingCalcLanes.length && + sourceLanesIndex < splitLaneOptions.length) { + int options = countOccurrences(splitLaneOptions[sourceLanesIndex], ';'); + for (int k = 0; k <= options && outgoingLanesIndex < outgoingCalcLanes.length; k++) { + usableLanes[sourceLanesIndex] |= outgoingCalcLanes[outgoingLanesIndex]; outgoingLanesIndex++; - sourceLanesIndex++; } + sourceLanesIndex++; } - - int[] newLanes = new int[sourceLanes.size()]; - - for (int i = 0; i < sourceLanes.size(); i++) { - newLanes[i] = sourceLanes.get(i); - } - - t.setLanes(newLanes); } - - assignTurns(splitLaneOptions, t); - t = inferTurnFromLanes(t, leftSide); - return t; + return usableLanes; } private int countOccurrences(String haystack, char needle) { @@ -742,7 +722,8 @@ public class RouteResultPreparation { return count; } - private void assignTurns(String[] splitLaneOptions, TurnType t) { + private int[] calculateRawTurnLanes(String[] splitLaneOptions, int calcTurnType) { + int[] lanes = new int[splitLaneOptions.length]; for (int i = 0; i < splitLaneOptions.length; i++) { String[] laneOptions = splitLaneOptions[i].split(";"); @@ -769,80 +750,64 @@ public class RouteResultPreparation { continue; } - if (TurnType.getPrimaryTurn(t.getLanes()[i]) == 0) { - t.setPrimaryTurn(i, turn); + if (TurnType.getPrimaryTurn(lanes[i]) == 0) { + TurnType.setPrimaryTurn(lanes, i, turn); } else { - if (turn == t.getValue()) { - t.setSecondaryTurn(i, TurnType.getPrimaryTurn(t.getLanes()[i])); - t.setPrimaryTurn(i, turn); + if (turn == calcTurnType) { + TurnType.setSecondaryTurn(lanes, i, TurnType.getPrimaryTurn(lanes[i])); + TurnType.setPrimaryTurn(lanes, i, turn); } else { - t.setSecondaryTurn(i, turn); + TurnType.setSecondaryTurn(lanes, i, turn); } - break; // Move on to the next lane } } } + return lanes; } - private TurnType inferTurnFromLanes(TurnType t, boolean leftSide) { - List possibleTurns = new ArrayList(); - for (int i = 0; i < t.getLanes().length; i++) { - if ((t.getLanes()[i] & 1) == 0) { + private int inferTurnFromLanes(int[] oLanes) { + TIntHashSet possibleTurns = new TIntHashSet(); + for (int i = 0; i < oLanes.length; i++) { + if ((oLanes[i] & 1) == 0) { continue; } - if (possibleTurns.isEmpty()) { // Nothing is in the list to compare to, so add the first elements - possibleTurns.add(TurnType.getPrimaryTurn(t.getLanes()[i])); - if (TurnType.getSecondaryTurn(t.getLanes()[i]) != 0) { - possibleTurns.add(TurnType.getSecondaryTurn(t.getLanes()[i])); + possibleTurns.add(TurnType.getPrimaryTurn(oLanes[i])); + if (TurnType.getSecondaryTurn(oLanes[i]) != 0) { + possibleTurns.add(TurnType.getSecondaryTurn(oLanes[i])); } } else { - List laneTurns = new ArrayList(); - laneTurns.add(TurnType.getPrimaryTurn(t.getLanes()[i])); - if (TurnType.getSecondaryTurn(t.getLanes()[i]) != 0) { - laneTurns.add(TurnType.getSecondaryTurn(t.getLanes()[i])); + TIntArrayList laneTurns = new TIntArrayList(); + laneTurns.add(TurnType.getPrimaryTurn(oLanes[i])); + if (TurnType.getSecondaryTurn(oLanes[i]) != 0) { + laneTurns.add(TurnType.getSecondaryTurn(oLanes[i])); } possibleTurns.retainAll(laneTurns); - if (possibleTurns.isEmpty()) { // No common turns, so can't determine anything. - return t; + return 0; } } } // Remove all turns from lanes not selected...because those aren't it - for (int i = 0; i < t.getLanes().length; i++) { - if ((t.getLanes()[i] & 1) == 0 && !possibleTurns.isEmpty()) { - List notLaneTurns = new ArrayList(); - notLaneTurns.add(TurnType.getPrimaryTurn(t.getLanes()[i])); - if (TurnType.getSecondaryTurn(t.getLanes()[i]) != 0) { - notLaneTurns.add(TurnType.getSecondaryTurn(t.getLanes()[i])); + for (int i = 0; i < oLanes.length; i++) { + if ((oLanes[i] & 1) == 0 && !possibleTurns.isEmpty()) { + possibleTurns.remove((Integer) TurnType.getPrimaryTurn(oLanes[i])); + if (TurnType.getSecondaryTurn(oLanes[i]) != 0) { + possibleTurns.remove((Integer) TurnType.getSecondaryTurn(oLanes[i])); } - possibleTurns.removeAll(notLaneTurns); } } // Checking to see that there is only one unique turn - if (new HashSet(possibleTurns).size() == 1) { - TurnType derivedTurnType = TurnType.valueOf(possibleTurns.get(0), leftSide); - derivedTurnType.setLanes(t.getLanes()); - derivedTurnType.setSkipToSpeak(t.isSkipToSpeak()); - t = derivedTurnType; - - // Because only the primary turn is displayed, if the turn to be taken is currently set as the secondary turn, then that needs to be switched around. - for (int i = 0; i < t.getLanes().length; i++) { - if (TurnType.getSecondaryTurn(t.getLanes()[i]) == t.getValue()) { - int temp = TurnType.getSecondaryTurn(t.getLanes()[i]); - t.setSecondaryTurn(i, TurnType.getPrimaryTurn(t.getLanes()[i])); - t.setPrimaryTurn(i, temp); - } - } + if (possibleTurns.size() == 1) { + return possibleTurns.iterator().next(); } - return t; + return 0; } private boolean isMotorway(RouteSegmentResult s){ diff --git a/OsmAnd-java/src/net/osmand/router/TurnType.java b/OsmAnd-java/src/net/osmand/router/TurnType.java index 981e4472f9..85be5bc5bb 100644 --- a/OsmAnd-java/src/net/osmand/router/TurnType.java +++ b/OsmAnd-java/src/net/osmand/router/TurnType.java @@ -163,6 +163,10 @@ public class TurnType { } // Note that there is no "weight" or ordering between the primary and secondary turns. + public static void setPrimaryTurn(int[] lanes, int lane, int turnType) { + lanes[lane] |= (turnType << 1); + } + public void setPrimaryTurn(int lane, int turnType) { lanes[lane] |= (turnType << 1); } @@ -172,6 +176,10 @@ public class TurnType { return (laneValue >> 1) & ((1 << 4) - 1); } + public static void setSecondaryTurn(int[] lanes, int lane, int turnType) { + lanes[lane] |= (turnType << 5); + } + public void setSecondaryTurn(int lane, int turnType) { lanes[lane] |= (turnType << 5); } @@ -237,4 +245,12 @@ public class TurnType { } return super.toString(); } + + public static boolean isLeftTurn(int type) { + return type == TL || type == TSHL || type == TSLL; + } + + public static boolean isRightTurn(int type) { + return type == TR || type == TSHR || type == TSLR; + } } \ No newline at end of file From e4689a830459047a28b2f58ef6d2c365124909b0 Mon Sep 17 00:00:00 2001 From: Roberto GEB Date: Sun, 23 Nov 2014 19:21:10 +0100 Subject: [PATCH 06/14] Translated using Weblate (Spanish) Currently translated at 100.0% (1562 of 1562 strings) --- OsmAnd/res/values-es/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index 728641672b..fc5f08b57a 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -1861,7 +1861,7 @@ Afganistán, Albania, Alemania, Andorra, Angola, Anguila, Antigua y Barbuda, Ant Distancia Grabar tus viajes Guardar tus trazas tocando un botón en la pantalla del mapa. Mostrar las opciones para grabar tus viajes a archivos GPX locales o usando un servicio web en línea. - Rutas de autobús, trolebús, transporte + Rutas de autobús, trolebús y lanzadera Guardar traza en fichero GPX Intervalo de guardado El registro de la posición en un archivo GPX puede activarse o desactivarse usando el control de grabación GPX en la pantalla del mapa @@ -1915,7 +1915,7 @@ Afganistán, Albania, Alemania, Andorra, Angola, Anguila, Antigua y Barbuda, Ant Rutas de autobús Ocultar Encender pantalla - Encender pantalla al aproximarse a un giro + Encender la pantalla al aproximarse a un giro %1$s necesita este permiso para apagar la pantalla para la característica de ahorro energético. Nunca Avanzado From c49defdff0cdabe33d85976c0194e5ad8a20c614 Mon Sep 17 00:00:00 2001 From: Leif Larsson Date: Sun, 23 Nov 2014 18:13:07 +0100 Subject: [PATCH 07/14] Translated using Weblate (Swedish) Currently translated at 99.4% (1552 of 1561 strings) --- OsmAnd/res/values-sv/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml index 47ba00a9ec..a5b1118425 100644 --- a/OsmAnd/res/values-sv/strings.xml +++ b/OsmAnd/res/values-sv/strings.xml @@ -1731,4 +1731,5 @@ %1$s behöver denna tillåtelse för att stänga av skärmen för strömsparningsfunktionen. Aldrig Avancerat + Använd https From 5ccab5531ca2002505060cb15578111cfb7efa0c Mon Sep 17 00:00:00 2001 From: jan madsen Date: Sun, 23 Nov 2014 17:36:31 +0100 Subject: [PATCH 08/14] Translated using Weblate (Danish) Currently translated at 100.0% (573 of 573 strings) --- OsmAnd/res/values-da/phrases.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml index f604fb3779..64aea7b0f4 100644 --- a/OsmAnd/res/values-da/phrases.xml +++ b/OsmAnd/res/values-da/phrases.xml @@ -493,7 +493,7 @@ Skomager Udstillingsbygger Stenhugger - Solafskærmning håndværk + Solafskærmning Skorstensfejer Skrædder Fliselægger @@ -529,7 +529,7 @@ Revisor Bitcoin betaling - Hule indgang + Huleindgang Bjergtinde Bjergsadel Vulkan @@ -552,14 +552,14 @@ Ankringsområde Ankerplads Båke - Cardinal båke + Kardinal båke Lateral båke Sikkervand båke Speciel formål båke Kajplads Sømærke bygning Sømærke bro - Cardinal tønde + Kardinal tønde Installation tønde Tønde, isoleret fare Lateral tønde @@ -597,7 +597,7 @@ Farezone Militærsøvelsesområde Militærflådebase - Nuklear eksplosion område + Nuklear eksplosionsområde Storby By Landsby From bf093c80c61365528a3773ea49f7d67a722e3542 Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Mon, 24 Nov 2014 01:00:55 +0100 Subject: [PATCH 09/14] Translated using Weblate (Italian) Currently translated at 100.0% (1561 of 1561 strings) --- OsmAnd/res/values-it/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index c9f8553ebd..aa42a818b7 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -2027,4 +2027,5 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Mai %1$s necessita di questa autorizzazione per spegnere lo schermo per la funzionalità di risparmio energetico. Avanzato + Usa https From de65c6816400c95bdbb9fe544c63a67884f20ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=20=EC=A1=B0?= Date: Mon, 24 Nov 2014 03:39:04 +0100 Subject: [PATCH 10/14] Translated using Weblate (Korean) Currently translated at 100.0% (1561 of 1561 strings) --- OsmAnd/res/values-ko/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-ko/strings.xml b/OsmAnd/res/values-ko/strings.xml index e9abb4c1fb..8d5f794ef9 100644 --- a/OsmAnd/res/values-ko/strings.xml +++ b/OsmAnd/res/values-ko/strings.xml @@ -2085,4 +2085,5 @@ %1$의 절전 기능에 대한 화면을 해제 하려면 이 권한이 필요 합니다. 결코 고급 + Https를 사용하기 From 078d6b5be8ed1c8f863dfd707e04b6e76d5e618a Mon Sep 17 00:00:00 2001 From: ezjerry liao Date: Mon, 24 Nov 2014 06:14:41 +0100 Subject: [PATCH 11/14] Translated using Weblate (Traditional Chinese) Currently translated at 100.0% (1562 of 1562 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 84de1d6475..eb856a62d6 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -1855,4 +1855,6 @@ 為了節電作用 %1$s 需要此許可權才能關閉螢幕。 永不 進階 + 使用安全協定連線於伺服器 + 使用 https From 98ff6ea761e7a2c825a4f61937a4bdd140dacbfa Mon Sep 17 00:00:00 2001 From: Ernst te Brake Date: Mon, 24 Nov 2014 18:44:24 +0100 Subject: [PATCH 12/14] Translated using Weblate (Dutch) Currently translated at 100.0% (1562 of 1562 strings) --- OsmAnd/res/values-nl/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index 1444ba37ef..253d913f49 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -2008,4 +2008,6 @@ Afghanistan, Albanie, Algerije, Andorra, Angola, Anguilla, Antigua en Barbuda, A Nooit %1$s heeft toestemming nodig om het scherm uit te kunnen schakelen (als onderdeel van de stroombesparende functie). Geavanceerd + Gebruik beveiligde verbinding met server + Gebruik https From b12637dea2a4580a45764189c554740fc2721749 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Mon, 24 Nov 2014 19:11:38 +0100 Subject: [PATCH 13/14] Translated using Weblate (Slovak) Currently translated at 100.0% (1562 of 1562 strings) --- OsmAnd/res/values-sk/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 9f97136ee5..03aeb3c3b6 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -2034,4 +2034,6 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, %1$s potrebuje toto oprávnenie na vypnutie obrazovky pre šetrenie energiou. Nikdy Pokročilé + Použiť zabezpečené spojenie so serverom + Použiť HTTPS From 81ba64c5497f0153ac0d50e0b56d1e88cbad3f20 Mon Sep 17 00:00:00 2001 From: Lu Ca Date: Mon, 24 Nov 2014 21:40:19 +0100 Subject: [PATCH 14/14] Translated using Weblate (Sardinian) Currently translated at 100.0% (1562 of 1562 strings) --- OsmAnd/res/values-sc/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 2a2d346abb..4a6b7281ff 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -1781,4 +1781,6 @@ Si cussigiat de annànghere unu o prus puntos intermedios pro megiorare sas pres Mai %1$s tenet bisòngiu de custa autorizatzione pro istudare s\'ischermu pro sa funtzionalidade de rispàrmiu energèticu. Avantzadas + Imprea una cunnessione segura cun su server + Imprea https