From 5a2ce9d3ce53f2e490900e23f677ae7454d5c0ee Mon Sep 17 00:00:00 2001 From: Arndt Brenschede Date: Sat, 7 Apr 2018 13:04:14 +0200 Subject: [PATCH] fixed bug for TR near start/end --- brouter-core/src/main/java/btools/router/OsmPath.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/brouter-core/src/main/java/btools/router/OsmPath.java b/brouter-core/src/main/java/btools/router/OsmPath.java index 2ce003e..8d0f53e 100644 --- a/brouter-core/src/main/java/btools/router/OsmPath.java +++ b/brouter-core/src/main/java/btools/router/OsmPath.java @@ -183,8 +183,10 @@ abstract class OsmPath implements OsmLinkHolder ele2 = transferNode.selev; } + boolean isStartpoint = lon0 == -1 && lat0 == -1; + // check turn restrictions (n detail mode (=final pass) no TR to not mess up voice hints) - if ( nsection == 0 && rc.considerTurnRestrictions && !detailMode ) + if ( nsection == 0 && rc.considerTurnRestrictions && !detailMode&& !isStartpoint ) { boolean hasAnyPositive = false; boolean hasPositive = false; @@ -252,6 +254,7 @@ abstract class OsmPath implements OsmLinkHolder resetState(); lon0 = -1; // reset turncost-pipe lat0 = -1; + isStartpoint = true; if ( recordTransferNodes ) { @@ -275,7 +278,6 @@ abstract class OsmPath implements OsmLinkHolder linkdisttotal += dist; // apply a start-direction if appropriate (by faking the origin position) - boolean isStartpoint = lon0 == -1 && lat0 == -1; if ( isStartpoint ) { if ( rc.startDirectionValid )