explicitly check for 90 degree turns / turning onto segregated roads

This commit is contained in:
Moritz Kobitzsch
2017-10-20 11:26:45 +02:00
committed by Michael Krasnyk
parent b8651bfac9
commit 704cf314d4
4 changed files with 134 additions and 51 deletions
@@ -140,6 +140,22 @@ class MergableRoadDetector
// The detector wants to prevent merges that are connected to `b-e`
bool IsLinkRoad(const NodeID intersection_node, const MergableRoadData &road) const;
// The condition suppresses roads merging for intersections like
// . .
// . .
// ---- ----
// . .
// . .
// but will allow roads merging for intersections like
// -------
// / \ 
// ---- ----
// \ /
// -------
bool IsCircularShape(const NodeID intersection_node,
const MergableRoadData &lhs,
const MergableRoadData &rhs) const;
const util::NodeBasedDynamicGraph &node_based_graph;
const EdgeBasedNodeDataContainer &node_data_container;
const std::vector<util::Coordinate> &node_coordinates;
@@ -149,6 +165,9 @@ class MergableRoadDetector
// name detection
const util::NameTable &name_table;
const SuffixTable &street_name_suffix_table;
// limit for detecting circles / parallel roads
const static double constexpr distance_to_extract = 150;
};
} // namespace guidance
@@ -123,7 +123,8 @@ struct SelectStraightmostRoadByNameAndOnlyChoice
{
SelectStraightmostRoadByNameAndOnlyChoice(const NameID desired_name_id,
const double initial_bearing,
const bool requires_entry);
const bool requires_entry,
const bool stop_on_ambiguous_turns);
/*
* !! REQUIRED - Function for the use of TraverseRoad in the graph walker.
@@ -141,6 +142,7 @@ struct SelectStraightmostRoadByNameAndOnlyChoice
const NameID desired_name_id;
const double initial_bearing;
const bool requires_entry;
const bool stop_on_ambiguous_turns;
};
// find the next intersection given a hop limit