forked from organicmaps/organicmaps
[routing] Route calculation on world graph in case of start and finish leaps.
This commit is contained in:
parent
451c081f8c
commit
899aa90144
1 changed files with 13 additions and 1 deletions
|
@ -305,7 +305,6 @@ IRouter::ResultCode IndexRouter::ProcessLeaps(vector<Segment> const & input,
|
|||
|
||||
WorldGraph & worldGraph = starter.GetGraph();
|
||||
WorldGraph::Mode const worldRouteMode = worldGraph.GetMode();
|
||||
worldGraph.SetMode(WorldGraph::Mode::SingleMwm);
|
||||
|
||||
for (size_t i = 0; i < input.size(); ++i)
|
||||
{
|
||||
|
@ -318,6 +317,19 @@ IRouter::ResultCode IndexRouter::ProcessLeaps(vector<Segment> const & input,
|
|||
continue;
|
||||
}
|
||||
|
||||
// In case of leaps from the start to its mwm transition and from finish mwm transition
|
||||
// Route calculation should be made on the world graph (WorldGraph::Mode::NoLeaps).
|
||||
if ((current.GetMwmId() == starter.GetStartVertex().GetMwmId()
|
||||
|| current.GetMwmId() == starter.GetFinishVertex().GetMwmId())
|
||||
&& worldRouteMode == WorldGraph::Mode::LeapsOnly)
|
||||
{
|
||||
worldGraph.SetMode(WorldGraph::Mode::NoLeaps);
|
||||
}
|
||||
else
|
||||
{
|
||||
worldGraph.SetMode(WorldGraph::Mode::SingleMwm);
|
||||
}
|
||||
|
||||
++i;
|
||||
CHECK_LESS(i, input.size(), ());
|
||||
Segment const & next = input[i];
|
||||
|
|
Loading…
Add table
Reference in a new issue