Skip to content

Commit

Permalink
Fix case for sliproads from link via link to primary, #4348/4
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase committed Oct 4, 2017
1 parent 53551fc commit a402079
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- Exposes `use_threads_number=Number` parameter of `EngineConfig` to limit a number of threads in a TBB internal pool
- Internals
- MLD uses a unidirectional Dijkstra for 1-to-N and N-to-1 matrices
- Guidance
- Fixed some cases of sliproads pre-processing ([#4348](https://github.com/Project-OSRM/osrm-backend/issues/4348)

# 5.12.0
- Guidance
Expand Down
4 changes: 2 additions & 2 deletions features/guidance/dedicated-turn-roads.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1021,5 +1021,5 @@ Feature: Slipways and Dedicated Turn Lanes


When I route I should get
| waypoints | route | turns | locations |
| s,f | sab,ae,dbcf,dbcf | depart,turn right,turn slight right,arrive | s,a,c,f |
| waypoints | route | turns | locations |
| s,f | sab,dbcf,dbcf | depart,turn right,arrive | s,a,f |
13 changes: 5 additions & 8 deletions src/extractor/guidance/sliproad_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,21 +701,18 @@ bool SliproadHandler::isValidSliproadLink(const IntersectionViewData &sliproad,
const IntersectionViewData &first,
const IntersectionViewData &second) const
{
// If the Sliproad is not a link we don't care
// If the sliproad is not a link we don't care
const auto &sliproad_data = node_based_graph.GetEdgeData(sliproad.eid);
if (!sliproad_data.road_classification.IsLinkClass())
{
return true;
}

// otherwise neither the first road leading to the intersection we shortcut
const auto &first_road_data = node_based_graph.GetEdgeData(first.eid);
if (first_road_data.road_classification.IsLinkClass())
{
return false;
}
// otherwise the first road leading to the intersection we shortcut
// can be a link or a usual road (ignore the check at this place)
(void)first;

// nor the second road coming from the intersection we shotcut must be links
// and the second road coming from the intersection we shortcut must be a non-link
const auto &second_road_data = node_based_graph.GetEdgeData(second.eid);
if (second_road_data.road_classification.IsLinkClass())
{
Expand Down

0 comments on commit a402079

Please sign in to comment.