Take stop signs into account during routing
This commit is contained in:
@@ -138,7 +138,7 @@ class EdgeBasedGraphFactory
|
||||
const std::unordered_set<NodeID> &m_barrier_nodes;
|
||||
const TrafficFlowControlNodes &m_traffic_signals;
|
||||
const TrafficFlowControlNodes &m_stop_signs;
|
||||
|
||||
|
||||
const CompressedEdgeContainer &m_compressed_edge_container;
|
||||
|
||||
const NameTable &name_table;
|
||||
|
||||
@@ -26,6 +26,10 @@ namespace extractor
|
||||
*/
|
||||
class ExtractionContainers
|
||||
{
|
||||
public:
|
||||
using InputTrafficFlowControlNode = std::pair<OSMNodeID, TrafficFlowControlNodeDirection>;
|
||||
|
||||
private:
|
||||
using ReferencedWays = std::unordered_map<OSMWayID, NodesOfWay>;
|
||||
using ReferencedTrafficFlowControlNodes =
|
||||
std::pair<std::unordered_set<OSMNodeID>, std::unordered_multimap<OSMNodeID, OSMNodeID>>;
|
||||
@@ -34,15 +38,16 @@ class ExtractionContainers
|
||||
// node processing so that they can be referenced in the preparation phase.
|
||||
ReferencedWays IdentifyRestrictionWays();
|
||||
ReferencedWays IdentifyManeuverOverrideWays();
|
||||
ReferencedTrafficFlowControlNodes IdentifyTrafficSignals();
|
||||
ReferencedTrafficFlowControlNodes IdentifyStopSigns();
|
||||
|
||||
|
||||
ReferencedTrafficFlowControlNodes IdentifyTrafficFlowControlNodes(
|
||||
const std::vector<InputTrafficFlowControlNode> &external_stop_signs);
|
||||
|
||||
void PrepareNodes();
|
||||
void PrepareManeuverOverrides(const ReferencedWays &maneuver_override_ways);
|
||||
void PrepareRestrictions(const ReferencedWays &restriction_ways);
|
||||
void PrepareTrafficSignals(const ReferencedTrafficFlowControlNodes &referenced_traffic_signals);
|
||||
void PrepareStopSigns(const ReferencedTrafficFlowControlNodes &referenced_stop_signs);
|
||||
void PrepareTrafficFlowControlNodes(
|
||||
const ReferencedTrafficFlowControlNodes &referenced_traffic_control_nodes,
|
||||
TrafficFlowControlNodes &internal_traffic_control_nodes);
|
||||
|
||||
void PrepareEdges(ScriptingEnvironment &scripting_environment);
|
||||
|
||||
@@ -57,10 +62,7 @@ class ExtractionContainers
|
||||
using NameOffsets = std::vector<size_t>;
|
||||
using WayIDVector = std::vector<OSMWayID>;
|
||||
using WayNodeIDOffsets = std::vector<size_t>;
|
||||
using InputTrafficFlowControlNode = std::pair<OSMNodeID, TrafficFlowControlNodeDirection>;
|
||||
|
||||
|
||||
|
||||
std::vector<OSMNodeID> barrier_nodes;
|
||||
NodeIDVector used_node_id_list;
|
||||
NodeVector all_nodes_list;
|
||||
@@ -79,10 +81,10 @@ class ExtractionContainers
|
||||
|
||||
std::vector<InputTrafficFlowControlNode> external_stop_signs;
|
||||
TrafficFlowControlNodes internal_stop_signs;
|
||||
|
||||
|
||||
std::vector<InputTrafficFlowControlNode> external_give_ways;
|
||||
TrafficFlowControlNodes internal_give_ways;
|
||||
|
||||
|
||||
std::vector<NodeBasedEdge> used_edges;
|
||||
|
||||
// List of restrictions (conditional and unconditional) before we transform them into the
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace osrm
|
||||
namespace extractor
|
||||
{
|
||||
|
||||
|
||||
struct ExtractionNode
|
||||
{
|
||||
ExtractionNode() : traffic_lights(TrafficFlowControlNodeDirection::NONE), barrier(false) {}
|
||||
@@ -23,7 +22,6 @@ struct ExtractionNode
|
||||
TrafficFlowControlNodeDirection traffic_lights;
|
||||
bool barrier;
|
||||
|
||||
|
||||
TrafficFlowControlNodeDirection stop_sign;
|
||||
TrafficFlowControlNodeDirection give_way;
|
||||
};
|
||||
|
||||
@@ -76,7 +76,8 @@ struct ExtractionTurn
|
||||
const std::vector<ExtractionTurnLeg> &roads_on_the_right,
|
||||
const std::vector<ExtractionTurnLeg> &roads_on_the_left)
|
||||
: angle(180. - angle), number_of_roads(number_of_roads), is_u_turn(is_u_turn),
|
||||
has_traffic_light(has_traffic_light), has_stop_sign(has_stop_sign), is_left_hand_driving(is_left_hand_driving),
|
||||
has_traffic_light(has_traffic_light), has_stop_sign(has_stop_sign),
|
||||
is_left_hand_driving(is_left_hand_driving),
|
||||
|
||||
source_restricted(source_restricted), source_mode(source_mode),
|
||||
source_is_motorway(source_is_motorway), source_is_link(source_is_link),
|
||||
|
||||
@@ -73,7 +73,6 @@ class ExtractorCallbacks
|
||||
bool fallback_to_duration;
|
||||
bool force_split_edges;
|
||||
|
||||
|
||||
public:
|
||||
using ClassesMap = std::unordered_map<std::string, ClassData>;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class NodeBasedGraphFactory
|
||||
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
||||
const TrafficFlowControlNodes &traffic_signals,
|
||||
const TrafficFlowControlNodes &stop_signs,
|
||||
|
||||
|
||||
std::unordered_set<NodeID> &&barriers,
|
||||
std::vector<util::Coordinate> &&coordinates,
|
||||
extractor::PackedOSMIDs &&osm_node_ids,
|
||||
|
||||
@@ -17,7 +17,6 @@ namespace extractor
|
||||
//
|
||||
// Impl. detail: namespace + enum instead of enum class to make Luabind happy
|
||||
|
||||
|
||||
// The traffic light annotation is extracted from node tags.
|
||||
// The directions in which the traffic light applies are relative to the way containing the node.
|
||||
enum class TrafficFlowControlNodeDirection : std::uint8_t
|
||||
|
||||
Reference in New Issue
Block a user