forked from organicmaps/organicmaps
Removing turns in the case if (1) source and target names are the same; (2) the angle between is TurnSlightRight, TurnSlightLeft or GoStraight
This commit is contained in:
parent
d95477b121
commit
e619d29e14
3 changed files with 13 additions and 0 deletions
|
@ -997,6 +997,14 @@ void OsrmRouter::FixupTurns(vector<m2::PointD> const & points, Route::TurnsT & t
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!t.m_srcName.empty()
|
||||
&& t.m_srcName == t.m_trgName
|
||||
&& turns::IsTurnSlightOrStraight(t.m_turn))
|
||||
{
|
||||
turnsDir.erase(turnsDir.begin() + idx);
|
||||
continue;
|
||||
}
|
||||
|
||||
++idx;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,6 +54,10 @@ bool IsStayOnRoad(TurnDirection t)
|
|||
return (t == turns::GoStraight || t == turns::StayOnRoundAbout);
|
||||
}
|
||||
|
||||
bool IsTurnSlightOrStraight(TurnDirection t)
|
||||
{
|
||||
return (t == GoStraight || t == TurnSlightRight || t == TurnSlightLeft);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ bool IsLeftTurn(TurnDirection t);
|
|||
bool IsRightTurn(TurnDirection t);
|
||||
bool IsLeftOrRightTurn(TurnDirection t);
|
||||
bool IsStayOnRoad(TurnDirection t);
|
||||
bool IsTurnSlightOrStraight(TurnDirection t);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue