fix edge discovery in tile plugin
This commit is contained in:
parent
5a293e891b
commit
6ec505281e
@ -22,6 +22,7 @@
|
|||||||
- fixed compile errors in tile unit-test framework
|
- fixed compile errors in tile unit-test framework
|
||||||
- fixed a bug that could result in inconsistent behaviour when collapsing instructions
|
- fixed a bug that could result in inconsistent behaviour when collapsing instructions
|
||||||
- fixed a bug that could result in crashes when leaving a ferry directly onto a motorway ramp
|
- fixed a bug that could result in crashes when leaving a ferry directly onto a motorway ramp
|
||||||
|
- fixed a bug in the tile plugin that resulted in discovering invalid edges for connections
|
||||||
- Debug Tiles
|
- Debug Tiles
|
||||||
- Added support for turn penalties
|
- Added support for turn penalties
|
||||||
|
|
||||||
|
@ -459,10 +459,22 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Find the connection between our source road and the target node
|
// Find the connection between our source road and the target node
|
||||||
EdgeID smaller_edge_id = facade->FindSmallestEdge(
|
// Since we only want to find direct edges, we cannot check shortcut edges here.
|
||||||
approachedge.edge_based_node_id,
|
// Otherwise we might find a forward edge even though a shorter backward edge
|
||||||
exit_edge.edge_based_node_id,
|
// exists (due to oneways).
|
||||||
[](const contractor::QueryEdge::EdgeData &data) { return data.forward; });
|
//
|
||||||
|
// a > - > - > - b
|
||||||
|
// | |
|
||||||
|
// |------ c ----|
|
||||||
|
//
|
||||||
|
// would offer a backward edge at `b` to `a` (due to the oneway from a to b)
|
||||||
|
// but could also offer a shortcut (b-c-a) from `b` to `a` which is longer.
|
||||||
|
EdgeID smaller_edge_id =
|
||||||
|
facade->FindSmallestEdge(approachedge.edge_based_node_id,
|
||||||
|
exit_edge.edge_based_node_id,
|
||||||
|
[](const contractor::QueryEdge::EdgeData &data) {
|
||||||
|
return data.forward && !data.shortcut;
|
||||||
|
});
|
||||||
|
|
||||||
// Depending on how the graph is constructed, we might have to look for
|
// Depending on how the graph is constructed, we might have to look for
|
||||||
// a backwards edge instead. They're equivalent, just one is available for
|
// a backwards edge instead. They're equivalent, just one is available for
|
||||||
@ -475,7 +487,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
|||||||
exit_edge.edge_based_node_id,
|
exit_edge.edge_based_node_id,
|
||||||
approachedge.edge_based_node_id,
|
approachedge.edge_based_node_id,
|
||||||
[](const contractor::QueryEdge::EdgeData &data) {
|
[](const contractor::QueryEdge::EdgeData &data) {
|
||||||
return data.backward;
|
return data.backward && !data.shortcut;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user