Take stop signs into account during routing
This commit is contained in:
parent
72ea34f3b7
commit
36f3a5eec8
@ -69,8 +69,8 @@ class EdgeBasedGraphFactory
|
|||||||
EdgeBasedNodeDataContainer &node_data_container,
|
EdgeBasedNodeDataContainer &node_data_container,
|
||||||
const CompressedEdgeContainer &compressed_edge_container,
|
const CompressedEdgeContainer &compressed_edge_container,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const TrafficSignals &traffic_signals,
|
const TrafficFlowControlNodes &traffic_signals,
|
||||||
const StopSigns &stop_signs,
|
const TrafficFlowControlNodes &stop_signs,
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const NameTable &name_table,
|
const NameTable &name_table,
|
||||||
const std::unordered_set<EdgeID> &segregated_edges,
|
const std::unordered_set<EdgeID> &segregated_edges,
|
||||||
@ -136,8 +136,8 @@ class EdgeBasedGraphFactory
|
|||||||
const util::NodeBasedDynamicGraph &m_node_based_graph;
|
const util::NodeBasedDynamicGraph &m_node_based_graph;
|
||||||
|
|
||||||
const std::unordered_set<NodeID> &m_barrier_nodes;
|
const std::unordered_set<NodeID> &m_barrier_nodes;
|
||||||
const TrafficSignals &m_traffic_signals;
|
const TrafficFlowControlNodes &m_traffic_signals;
|
||||||
const StopSigns &m_stop_signs;
|
const TrafficFlowControlNodes &m_stop_signs;
|
||||||
|
|
||||||
const CompressedEdgeContainer &m_compressed_edge_container;
|
const CompressedEdgeContainer &m_compressed_edge_container;
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include "extractor/scripting_environment.hpp"
|
#include "extractor/scripting_environment.hpp"
|
||||||
|
|
||||||
#include "storage/tar_fwd.hpp"
|
#include "storage/tar_fwd.hpp"
|
||||||
#include "traffic_lights.hpp"
|
|
||||||
#include "traffic_signals.hpp"
|
#include "traffic_signals.hpp"
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
@ -28,25 +27,22 @@ namespace extractor
|
|||||||
class ExtractionContainers
|
class ExtractionContainers
|
||||||
{
|
{
|
||||||
using ReferencedWays = std::unordered_map<OSMWayID, NodesOfWay>;
|
using ReferencedWays = std::unordered_map<OSMWayID, NodesOfWay>;
|
||||||
using ReferencedTrafficSignals =
|
using ReferencedTrafficFlowControlNodes =
|
||||||
std::pair<std::unordered_set<OSMNodeID>, std::unordered_multimap<OSMNodeID, OSMNodeID>>;
|
std::pair<std::unordered_set<OSMNodeID>, std::unordered_multimap<OSMNodeID, OSMNodeID>>;
|
||||||
using ReferencedStopSigns =
|
|
||||||
std::pair<std::unordered_set<OSMNodeID>, std::unordered_multimap<OSMNodeID, OSMNodeID>>;
|
|
||||||
|
|
||||||
// The relationship between way and nodes is lost during node preparation.
|
// The relationship between way and nodes is lost during node preparation.
|
||||||
// We identify the ways and nodes relevant to restrictions/overrides/signals prior to
|
// We identify the ways and nodes relevant to restrictions/overrides/signals prior to
|
||||||
// node processing so that they can be referenced in the preparation phase.
|
// node processing so that they can be referenced in the preparation phase.
|
||||||
ReferencedWays IdentifyRestrictionWays();
|
ReferencedWays IdentifyRestrictionWays();
|
||||||
ReferencedWays IdentifyManeuverOverrideWays();
|
ReferencedWays IdentifyManeuverOverrideWays();
|
||||||
ReferencedTrafficSignals IdentifyTrafficSignals();
|
ReferencedTrafficFlowControlNodes IdentifyTrafficSignals();
|
||||||
ReferencedStopSigns IdentifyStopSigns();
|
ReferencedTrafficFlowControlNodes IdentifyStopSigns();
|
||||||
|
|
||||||
|
|
||||||
void PrepareNodes();
|
void PrepareNodes();
|
||||||
void PrepareManeuverOverrides(const ReferencedWays &maneuver_override_ways);
|
void PrepareManeuverOverrides(const ReferencedWays &maneuver_override_ways);
|
||||||
void PrepareRestrictions(const ReferencedWays &restriction_ways);
|
void PrepareRestrictions(const ReferencedWays &restriction_ways);
|
||||||
void PrepareTrafficSignals(const ReferencedTrafficSignals &referenced_traffic_signals);
|
void PrepareTrafficSignals(const ReferencedTrafficFlowControlNodes &referenced_traffic_signals);
|
||||||
void PrepareStopSigns(const ReferencedStopSigns &referenced_stop_signs);
|
void PrepareStopSigns(const ReferencedTrafficFlowControlNodes &referenced_stop_signs);
|
||||||
|
|
||||||
void PrepareEdges(ScriptingEnvironment &scripting_environment);
|
void PrepareEdges(ScriptingEnvironment &scripting_environment);
|
||||||
|
|
||||||
@ -61,10 +57,10 @@ class ExtractionContainers
|
|||||||
using NameOffsets = std::vector<size_t>;
|
using NameOffsets = std::vector<size_t>;
|
||||||
using WayIDVector = std::vector<OSMWayID>;
|
using WayIDVector = std::vector<OSMWayID>;
|
||||||
using WayNodeIDOffsets = std::vector<size_t>;
|
using WayNodeIDOffsets = std::vector<size_t>;
|
||||||
using InputTrafficSignal = std::pair<OSMNodeID, TrafficLightClass::Direction>;
|
using InputTrafficFlowControlNode = std::pair<OSMNodeID, TrafficFlowControlNodeDirection>;
|
||||||
using InputStopSign = std::pair<OSMNodeID, StopSign::Direction>;
|
|
||||||
using InputGiveWay = std::pair<OSMNodeID, GiveWay::Direction>;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<OSMNodeID> barrier_nodes;
|
std::vector<OSMNodeID> barrier_nodes;
|
||||||
NodeIDVector used_node_id_list;
|
NodeIDVector used_node_id_list;
|
||||||
NodeVector all_nodes_list;
|
NodeVector all_nodes_list;
|
||||||
@ -78,15 +74,14 @@ class ExtractionContainers
|
|||||||
|
|
||||||
unsigned max_internal_node_id;
|
unsigned max_internal_node_id;
|
||||||
|
|
||||||
std::vector<InputTrafficSignal> external_traffic_signals;
|
std::vector<InputTrafficFlowControlNode> external_traffic_signals;
|
||||||
TrafficSignals internal_traffic_signals;
|
TrafficFlowControlNodes internal_traffic_signals;
|
||||||
|
|
||||||
|
std::vector<InputTrafficFlowControlNode> external_stop_signs;
|
||||||
std::vector<InputStopSign> external_stop_signs;
|
TrafficFlowControlNodes internal_stop_signs;
|
||||||
StopSigns internal_stop_signs;
|
|
||||||
|
|
||||||
std::vector<InputStopSign> external_give_ways;
|
std::vector<InputTrafficFlowControlNode> external_give_ways;
|
||||||
GiveWaySigns internal_give_ways;
|
TrafficFlowControlNodes internal_give_ways;
|
||||||
|
|
||||||
std::vector<NodeBasedEdge> used_edges;
|
std::vector<NodeBasedEdge> used_edges;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef EXTRACTION_NODE_HPP
|
#ifndef EXTRACTION_NODE_HPP
|
||||||
#define EXTRACTION_NODE_HPP
|
#define EXTRACTION_NODE_HPP
|
||||||
|
|
||||||
#include "traffic_lights.hpp"
|
#include "traffic_signals.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
@ -12,20 +12,20 @@ namespace extractor
|
|||||||
|
|
||||||
struct ExtractionNode
|
struct ExtractionNode
|
||||||
{
|
{
|
||||||
ExtractionNode() : traffic_lights(TrafficLightClass::NONE), barrier(false) {}
|
ExtractionNode() : traffic_lights(TrafficFlowControlNodeDirection::NONE), barrier(false) {}
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
traffic_lights = TrafficLightClass::NONE;
|
traffic_lights = TrafficFlowControlNodeDirection::NONE;
|
||||||
stop_sign = StopSign::Direction::NONE;
|
stop_sign = TrafficFlowControlNodeDirection::NONE;
|
||||||
give_way = GiveWay::Direction::NONE;
|
give_way = TrafficFlowControlNodeDirection::NONE;
|
||||||
barrier = false;
|
barrier = false;
|
||||||
}
|
}
|
||||||
TrafficLightClass::Direction traffic_lights;
|
TrafficFlowControlNodeDirection traffic_lights;
|
||||||
bool barrier;
|
bool barrier;
|
||||||
|
|
||||||
|
|
||||||
StopSign::Direction stop_sign;
|
TrafficFlowControlNodeDirection stop_sign;
|
||||||
GiveWay::Direction give_way;
|
TrafficFlowControlNodeDirection give_way;
|
||||||
};
|
};
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
@ -66,8 +66,8 @@ class Extractor
|
|||||||
LaneDescriptionMap turn_lane_map;
|
LaneDescriptionMap turn_lane_map;
|
||||||
std::vector<TurnRestriction> turn_restrictions;
|
std::vector<TurnRestriction> turn_restrictions;
|
||||||
std::vector<UnresolvedManeuverOverride> unresolved_maneuver_overrides;
|
std::vector<UnresolvedManeuverOverride> unresolved_maneuver_overrides;
|
||||||
TrafficSignals traffic_signals;
|
TrafficFlowControlNodes traffic_signals;
|
||||||
StopSigns stop_signs;
|
TrafficFlowControlNodes stop_signs;
|
||||||
std::unordered_set<NodeID> barriers;
|
std::unordered_set<NodeID> barriers;
|
||||||
std::vector<util::Coordinate> osm_coordinates;
|
std::vector<util::Coordinate> osm_coordinates;
|
||||||
extractor::PackedOSMIDs osm_node_ids;
|
extractor::PackedOSMIDs osm_node_ids;
|
||||||
@ -87,8 +87,8 @@ class Extractor
|
|||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const CompressedEdgeContainer &compressed_edge_container,
|
const CompressedEdgeContainer &compressed_edge_container,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const TrafficSignals &traffic_signals,
|
const TrafficFlowControlNodes &traffic_signals,
|
||||||
const StopSigns &stop_signs,
|
const TrafficFlowControlNodes &stop_signs,
|
||||||
const RestrictionGraph &restriction_graph,
|
const RestrictionGraph &restriction_graph,
|
||||||
const std::unordered_set<EdgeID> &segregated_edges,
|
const std::unordered_set<EdgeID> &segregated_edges,
|
||||||
const NameTable &name_table,
|
const NameTable &name_table,
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
namespace osmium
|
namespace osmium
|
||||||
{
|
{
|
||||||
@ -72,6 +73,7 @@ class ExtractorCallbacks
|
|||||||
bool fallback_to_duration;
|
bool fallback_to_duration;
|
||||||
bool force_split_edges;
|
bool force_split_edges;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ClassesMap = std::unordered_map<std::string, ClassData>;
|
using ClassesMap = std::unordered_map<std::string, ClassData>;
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ class GraphCompressor
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void Compress(const std::unordered_set<NodeID> &barrier_nodes,
|
void Compress(const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const TrafficSignals &traffic_signals,
|
const TrafficFlowControlNodes &traffic_signals,
|
||||||
const StopSigns &stop_signs,
|
const TrafficFlowControlNodes &stop_signs,
|
||||||
ScriptingEnvironment &scripting_environment,
|
ScriptingEnvironment &scripting_environment,
|
||||||
std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
||||||
|
@ -41,8 +41,8 @@ class NodeBasedGraphFactory
|
|||||||
NodeBasedGraphFactory(ScriptingEnvironment &scripting_environment,
|
NodeBasedGraphFactory(ScriptingEnvironment &scripting_environment,
|
||||||
std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
||||||
const TrafficSignals &traffic_signals,
|
const TrafficFlowControlNodes &traffic_signals,
|
||||||
const StopSigns &stop_signs,
|
const TrafficFlowControlNodes &stop_signs,
|
||||||
|
|
||||||
std::unordered_set<NodeID> &&barriers,
|
std::unordered_set<NodeID> &&barriers,
|
||||||
std::vector<util::Coordinate> &&coordinates,
|
std::vector<util::Coordinate> &&coordinates,
|
||||||
@ -75,8 +75,8 @@ class NodeBasedGraphFactory
|
|||||||
void Compress(ScriptingEnvironment &scripting_environment,
|
void Compress(ScriptingEnvironment &scripting_environment,
|
||||||
std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
||||||
const TrafficSignals &traffic_signals,
|
const TrafficFlowControlNodes &traffic_signals,
|
||||||
const StopSigns &stop_signs);
|
const TrafficFlowControlNodes &stop_signs);
|
||||||
|
|
||||||
// Most ways are bidirectional, making the geometry in forward and backward direction the same,
|
// Most ways are bidirectional, making the geometry in forward and backward direction the same,
|
||||||
// except for reversal. We make use of this fact by keeping only one representation of the
|
// except for reversal. We make use of this fact by keeping only one representation of the
|
||||||
|
@ -1,56 +0,0 @@
|
|||||||
#ifndef OSRM_EXTRACTOR_TRAFFIC_LIGHTS_DATA_HPP_
|
|
||||||
#define OSRM_EXTRACTOR_TRAFFIC_LIGHTS_DATA_HPP_
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
namespace osrm
|
|
||||||
{
|
|
||||||
namespace extractor
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace TrafficLightClass
|
|
||||||
{
|
|
||||||
// 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 Direction
|
|
||||||
{
|
|
||||||
NONE = 0,
|
|
||||||
DIRECTION_ALL = 1,
|
|
||||||
DIRECTION_FORWARD = 2,
|
|
||||||
DIRECTION_REVERSE = 3
|
|
||||||
};
|
|
||||||
} // namespace TrafficLightClass
|
|
||||||
|
|
||||||
// Stop Signs tagged on nodes can be present or not. In addition Stop Signs have
|
|
||||||
// an optional way direction they apply to. If the direction is unknown from the
|
|
||||||
// data we have to compute by checking the distance to the next intersection.
|
|
||||||
//
|
|
||||||
// Impl. detail: namespace + enum instead of enum class to make Luabind happy
|
|
||||||
namespace StopSign
|
|
||||||
{
|
|
||||||
enum Direction : std::uint8_t
|
|
||||||
{
|
|
||||||
NONE = 0,
|
|
||||||
DIRECTION_ALL = 1,
|
|
||||||
DIRECTION_FORWARD = 2,
|
|
||||||
DIRECTION_REVERSE = 3
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Give Way is the complement to priority roads. Tagging is the same as Stop Signs.
|
|
||||||
// See explanation above.
|
|
||||||
namespace GiveWay
|
|
||||||
{
|
|
||||||
enum Direction : std::uint8_t
|
|
||||||
{
|
|
||||||
NONE = 0,
|
|
||||||
DIRECTION_ALL = 1,
|
|
||||||
DIRECTION_FORWARD = 2,
|
|
||||||
DIRECTION_REVERSE = 3
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace extractor
|
|
||||||
} // namespace osrm
|
|
||||||
|
|
||||||
#endif // OSRM_EXTRACTOR_TRAFFIC_LIGHTS_DATA_HPP_
|
|
@ -11,26 +11,36 @@ namespace osrm
|
|||||||
namespace extractor
|
namespace extractor
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO: better naming
|
// Stop Signs tagged on nodes can be present or not. In addition Stop Signs have
|
||||||
struct RoadObjects
|
// an optional way direction they apply to. If the direction is unknown from the
|
||||||
|
// data we have to compute by checking the distance to the next intersection.
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
{
|
||||||
|
NONE = 0,
|
||||||
|
ALL = 1,
|
||||||
|
FORWARD = 2,
|
||||||
|
REVERSE = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
// represents traffic lights, stop signs, give way signs, etc.
|
||||||
|
struct TrafficFlowControlNodes
|
||||||
{
|
{
|
||||||
std::unordered_set<NodeID> bidirectional_nodes;
|
std::unordered_set<NodeID> bidirectional_nodes;
|
||||||
std::unordered_set<std::pair<NodeID, NodeID>, boost::hash<std::pair<NodeID, NodeID>>>
|
std::unordered_set<std::pair<NodeID, NodeID>, boost::hash<std::pair<NodeID, NodeID>>>
|
||||||
unidirectional_segments;
|
unidirectional_segments;
|
||||||
|
|
||||||
inline bool HasSignal(NodeID from, NodeID to) const
|
inline bool Has(NodeID from, NodeID to) const
|
||||||
{
|
{
|
||||||
return bidirectional_nodes.count(to) > 0 || unidirectional_segments.count({from, to}) > 0;
|
return bidirectional_nodes.count(to) > 0 || unidirectional_segments.count({from, to}) > 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TrafficSignals final : public RoadObjects {};
|
|
||||||
|
|
||||||
// TODO: better naming ?
|
|
||||||
struct StopSigns final : public RoadObjects {};
|
|
||||||
struct GiveWaySigns final : public RoadObjects {};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|
||||||
|
@ -6,17 +6,15 @@ function GiveWay.get_value(node)
|
|||||||
local direction = node:get_value_by_key("direction")
|
local direction = node:get_value_by_key("direction")
|
||||||
if direction then
|
if direction then
|
||||||
if "forward" == direction then
|
if "forward" == direction then
|
||||||
return give_way.direction_forward
|
return traffic_flow_control_direction.direction_forward
|
||||||
end
|
end
|
||||||
if "backward" == direction then
|
if "backward" == direction then
|
||||||
return give_way.direction_reverse
|
return traffic_flow_control_direction.direction_reverse
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- return give_way.direction_all
|
return traffic_flow_control_direction.direction_all
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
-- return give_way.none
|
return traffic_flow_control_direction.none
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return GiveWay
|
return GiveWay
|
||||||
|
@ -6,15 +6,15 @@ function StopSign.get_value(node)
|
|||||||
local direction = node:get_value_by_key("direction")
|
local direction = node:get_value_by_key("direction")
|
||||||
if direction then
|
if direction then
|
||||||
if "forward" == direction then
|
if "forward" == direction then
|
||||||
return stop_sign.direction_forward
|
return traffic_flow_control_direction.direction_forward
|
||||||
end
|
end
|
||||||
if "backward" == direction then
|
if "backward" == direction then
|
||||||
return stop_sign.direction_reverse
|
return traffic_flow_control_direction.direction_reverse
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return stop_sign.direction_all
|
return traffic_flow_control_direction.direction_all
|
||||||
end
|
end
|
||||||
return stop_sign.none
|
return traffic_flow_control_direction.none
|
||||||
end
|
end
|
||||||
|
|
||||||
return StopSign
|
return StopSign
|
||||||
|
@ -59,8 +59,8 @@ EdgeBasedGraphFactory::EdgeBasedGraphFactory(
|
|||||||
EdgeBasedNodeDataContainer &node_data_container,
|
EdgeBasedNodeDataContainer &node_data_container,
|
||||||
const CompressedEdgeContainer &compressed_edge_container,
|
const CompressedEdgeContainer &compressed_edge_container,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const TrafficSignals &traffic_signals,
|
const TrafficFlowControlNodes &traffic_signals,
|
||||||
const StopSigns &stop_signs,
|
const TrafficFlowControlNodes &stop_signs,
|
||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const NameTable &name_table,
|
const NameTable &name_table,
|
||||||
const std::unordered_set<EdgeID> &segregated_edges,
|
const std::unordered_set<EdgeID> &segregated_edges,
|
||||||
@ -643,8 +643,8 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
|
|||||||
// In theory we shouldn't get a directed traffic light on a turn, as it indicates that
|
// In theory we shouldn't get a directed traffic light on a turn, as it indicates that
|
||||||
// the traffic signal direction was potentially ambiguously annotated on the junction
|
// the traffic signal direction was potentially ambiguously annotated on the junction
|
||||||
// node But we'll check anyway.
|
// node But we'll check anyway.
|
||||||
const auto is_traffic_light = m_traffic_signals.HasSignal(from_node, intersection_node);
|
const auto is_traffic_light = m_traffic_signals.Has(from_node, intersection_node);
|
||||||
const auto is_stop_sign = m_stop_signs.HasSignal(from_node, intersection_node);
|
const auto is_stop_sign = m_stop_signs.Has(from_node, intersection_node);
|
||||||
std::cerr << "IS STOP SIGN " << is_stop_sign << std::endl;
|
std::cerr << "IS STOP SIGN " << is_stop_sign << std::endl;
|
||||||
const auto is_uturn =
|
const auto is_uturn =
|
||||||
guidance::getTurnDirection(turn_angle) == guidance::DirectionModifier::UTurn;
|
guidance::getTurnDirection(turn_angle) == guidance::DirectionModifier::UTurn;
|
||||||
|
@ -939,7 +939,7 @@ ExtractionContainers::ReferencedWays ExtractionContainers::IdentifyManeuverOverr
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ExtractionContainers::PrepareTrafficSignals(
|
void ExtractionContainers::PrepareTrafficSignals(
|
||||||
const ExtractionContainers::ReferencedTrafficSignals &referenced_traffic_signals)
|
const ReferencedTrafficFlowControlNodes &referenced_traffic_signals)
|
||||||
{
|
{
|
||||||
const auto &bidirectional_signal_nodes = referenced_traffic_signals.first;
|
const auto &bidirectional_signal_nodes = referenced_traffic_signals.first;
|
||||||
const auto &unidirectional_signal_segments = referenced_traffic_signals.second;
|
const auto &unidirectional_signal_segments = referenced_traffic_signals.second;
|
||||||
@ -983,7 +983,7 @@ void ExtractionContainers::PrepareTrafficSignals(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: copy-paste
|
// TODO: copy-paste
|
||||||
void ExtractionContainers::PrepareStopSigns(const ReferencedStopSigns &referenced_stop_signs) {
|
void ExtractionContainers::PrepareStopSigns(const ReferencedTrafficFlowControlNodes &referenced_stop_signs) {
|
||||||
const auto &bidirectional_signal_nodes = referenced_stop_signs.first;
|
const auto &bidirectional_signal_nodes = referenced_stop_signs.first;
|
||||||
const auto &unidirectional_signal_segments = referenced_stop_signs.second;
|
const auto &unidirectional_signal_segments = referenced_stop_signs.second;
|
||||||
|
|
||||||
@ -1211,7 +1211,7 @@ ExtractionContainers::ReferencedWays ExtractionContainers::IdentifyRestrictionWa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: copy-paste
|
// TODO: copy-paste
|
||||||
ExtractionContainers::ReferencedStopSigns ExtractionContainers::IdentifyStopSigns()
|
ExtractionContainers::ReferencedTrafficFlowControlNodes ExtractionContainers::IdentifyStopSigns()
|
||||||
{
|
{
|
||||||
util::UnbufferedLog log;
|
util::UnbufferedLog log;
|
||||||
log << "Collecting traffic signal information on " << external_stop_signs.size()
|
log << "Collecting traffic signal information on " << external_stop_signs.size()
|
||||||
@ -1219,7 +1219,7 @@ ExtractionContainers::ReferencedStopSigns ExtractionContainers::IdentifyStopSign
|
|||||||
TIMER_START(identify_traffic_signals);
|
TIMER_START(identify_traffic_signals);
|
||||||
|
|
||||||
// Temporary store for nodes containing a unidirectional signal.
|
// Temporary store for nodes containing a unidirectional signal.
|
||||||
std::unordered_map<OSMNodeID, StopSign::Direction> unidirectional_signals;
|
std::unordered_map<OSMNodeID, TrafficFlowControlNodeDirection> unidirectional_signals;
|
||||||
|
|
||||||
// For each node that has a unidirectional traffic signal, we store the node(s)
|
// For each node that has a unidirectional traffic signal, we store the node(s)
|
||||||
// that lead up to the signal.
|
// that lead up to the signal.
|
||||||
@ -1228,14 +1228,14 @@ ExtractionContainers::ReferencedStopSigns ExtractionContainers::IdentifyStopSign
|
|||||||
std::unordered_set<OSMNodeID> bidirectional_signals;
|
std::unordered_set<OSMNodeID> bidirectional_signals;
|
||||||
|
|
||||||
const auto mark_signals = [&](auto const &traffic_signal) {
|
const auto mark_signals = [&](auto const &traffic_signal) {
|
||||||
if (traffic_signal.second == StopSign::DIRECTION_FORWARD ||
|
if (traffic_signal.second == TrafficFlowControlNodeDirection::FORWARD ||
|
||||||
traffic_signal.second == StopSign::DIRECTION_REVERSE)
|
traffic_signal.second == TrafficFlowControlNodeDirection::REVERSE)
|
||||||
{
|
{
|
||||||
unidirectional_signals.insert({traffic_signal.first, traffic_signal.second});
|
unidirectional_signals.insert({traffic_signal.first, traffic_signal.second});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(traffic_signal.second == StopSign::DIRECTION_ALL);
|
BOOST_ASSERT(traffic_signal.second == TrafficFlowControlNodeDirection::ALL);
|
||||||
bidirectional_signals.insert(traffic_signal.first);
|
bidirectional_signals.insert(traffic_signal.first);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1253,7 +1253,7 @@ ExtractionContainers::ReferencedStopSigns ExtractionContainers::IdentifyStopSign
|
|||||||
const auto sig = unidirectional_signals.find(*node_it);
|
const auto sig = unidirectional_signals.find(*node_it);
|
||||||
if (sig != unidirectional_signals.end())
|
if (sig != unidirectional_signals.end())
|
||||||
{
|
{
|
||||||
if (sig->second == StopSign::DIRECTION_FORWARD)
|
if (sig->second == TrafficFlowControlNodeDirection::FORWARD)
|
||||||
{
|
{
|
||||||
if (node_it != node_start_offset)
|
if (node_it != node_start_offset)
|
||||||
{
|
{
|
||||||
@ -1263,7 +1263,7 @@ ExtractionContainers::ReferencedStopSigns ExtractionContainers::IdentifyStopSign
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(sig->second == StopSign::DIRECTION_REVERSE);
|
BOOST_ASSERT(sig->second == TrafficFlowControlNodeDirection::REVERSE);
|
||||||
if (node_it + 1 != node_end_offset)
|
if (node_it + 1 != node_end_offset)
|
||||||
{
|
{
|
||||||
// Next node leads to signal
|
// Next node leads to signal
|
||||||
@ -1299,7 +1299,7 @@ ExtractionContainers::ReferencedStopSigns ExtractionContainers::IdentifyStopSign
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ExtractionContainers::ReferencedTrafficSignals ExtractionContainers::IdentifyTrafficSignals()
|
ExtractionContainers::ReferencedTrafficFlowControlNodes ExtractionContainers::IdentifyTrafficSignals()
|
||||||
{
|
{
|
||||||
util::UnbufferedLog log;
|
util::UnbufferedLog log;
|
||||||
log << "Collecting traffic signal information on " << external_traffic_signals.size()
|
log << "Collecting traffic signal information on " << external_traffic_signals.size()
|
||||||
@ -1307,7 +1307,7 @@ ExtractionContainers::ReferencedTrafficSignals ExtractionContainers::IdentifyTra
|
|||||||
TIMER_START(identify_traffic_signals);
|
TIMER_START(identify_traffic_signals);
|
||||||
|
|
||||||
// Temporary store for nodes containing a unidirectional signal.
|
// Temporary store for nodes containing a unidirectional signal.
|
||||||
std::unordered_map<OSMNodeID, TrafficLightClass::Direction> unidirectional_signals;
|
std::unordered_map<OSMNodeID, TrafficFlowControlNodeDirection> unidirectional_signals;
|
||||||
|
|
||||||
// For each node that has a unidirectional traffic signal, we store the node(s)
|
// For each node that has a unidirectional traffic signal, we store the node(s)
|
||||||
// that lead up to the signal.
|
// that lead up to the signal.
|
||||||
@ -1316,14 +1316,14 @@ ExtractionContainers::ReferencedTrafficSignals ExtractionContainers::IdentifyTra
|
|||||||
std::unordered_set<OSMNodeID> bidirectional_signals;
|
std::unordered_set<OSMNodeID> bidirectional_signals;
|
||||||
|
|
||||||
const auto mark_signals = [&](auto const &traffic_signal) {
|
const auto mark_signals = [&](auto const &traffic_signal) {
|
||||||
if (traffic_signal.second == TrafficLightClass::DIRECTION_FORWARD ||
|
if (traffic_signal.second == TrafficFlowControlNodeDirection::FORWARD ||
|
||||||
traffic_signal.second == TrafficLightClass::DIRECTION_REVERSE)
|
traffic_signal.second == TrafficFlowControlNodeDirection::REVERSE)
|
||||||
{
|
{
|
||||||
unidirectional_signals.insert({traffic_signal.first, traffic_signal.second});
|
unidirectional_signals.insert({traffic_signal.first, traffic_signal.second});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(traffic_signal.second == TrafficLightClass::DIRECTION_ALL);
|
BOOST_ASSERT(traffic_signal.second == TrafficFlowControlNodeDirection::ALL);
|
||||||
bidirectional_signals.insert(traffic_signal.first);
|
bidirectional_signals.insert(traffic_signal.first);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1341,7 +1341,7 @@ ExtractionContainers::ReferencedTrafficSignals ExtractionContainers::IdentifyTra
|
|||||||
const auto sig = unidirectional_signals.find(*node_it);
|
const auto sig = unidirectional_signals.find(*node_it);
|
||||||
if (sig != unidirectional_signals.end())
|
if (sig != unidirectional_signals.end())
|
||||||
{
|
{
|
||||||
if (sig->second == TrafficLightClass::DIRECTION_FORWARD)
|
if (sig->second == TrafficFlowControlNodeDirection::FORWARD)
|
||||||
{
|
{
|
||||||
if (node_it != node_start_offset)
|
if (node_it != node_start_offset)
|
||||||
{
|
{
|
||||||
@ -1351,7 +1351,7 @@ ExtractionContainers::ReferencedTrafficSignals ExtractionContainers::IdentifyTra
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(sig->second == TrafficLightClass::DIRECTION_REVERSE);
|
BOOST_ASSERT(sig->second == TrafficFlowControlNodeDirection::REVERSE);
|
||||||
if (node_it + 1 != node_end_offset)
|
if (node_it + 1 != node_end_offset)
|
||||||
{
|
{
|
||||||
// Next node leads to signal
|
// Next node leads to signal
|
||||||
|
@ -728,8 +728,8 @@ EdgeID Extractor::BuildEdgeExpandedGraph(
|
|||||||
const std::vector<util::Coordinate> &coordinates,
|
const std::vector<util::Coordinate> &coordinates,
|
||||||
const CompressedEdgeContainer &compressed_edge_container,
|
const CompressedEdgeContainer &compressed_edge_container,
|
||||||
const std::unordered_set<NodeID> &barrier_nodes,
|
const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const TrafficSignals &traffic_signals,
|
const TrafficFlowControlNodes &traffic_signals,
|
||||||
const StopSigns &stop_signs,
|
const TrafficFlowControlNodes &stop_signs,
|
||||||
const RestrictionGraph &restriction_graph,
|
const RestrictionGraph &restriction_graph,
|
||||||
const std::unordered_set<EdgeID> &segregated_edges,
|
const std::unordered_set<EdgeID> &segregated_edges,
|
||||||
const NameTable &name_table,
|
const NameTable &name_table,
|
||||||
|
@ -78,7 +78,7 @@ void ExtractorCallbacks::ProcessNode(const osmium::Node &input_node,
|
|||||||
{
|
{
|
||||||
external_memory.barrier_nodes.push_back(id);
|
external_memory.barrier_nodes.push_back(id);
|
||||||
}
|
}
|
||||||
if (result_node.traffic_lights != TrafficLightClass::NONE)
|
if (result_node.traffic_lights != TrafficFlowControlNodeDirection::NONE)
|
||||||
{
|
{
|
||||||
external_memory.external_traffic_signals.push_back({id, result_node.traffic_lights});
|
external_memory.external_traffic_signals.push_back({id, result_node.traffic_lights});
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ void ExtractorCallbacks::ProcessNode(const osmium::Node &input_node,
|
|||||||
// {
|
// {
|
||||||
// external_memory.external_give_ways.push_back({id, result_node.give_way});
|
// external_memory.external_give_ways.push_back({id, result_node.give_way});
|
||||||
// }
|
// }
|
||||||
if (result_node.stop_sign != StopSign::Direction::NONE)
|
if (result_node.stop_sign != TrafficFlowControlNodeDirection::NONE)
|
||||||
{
|
{
|
||||||
std::cerr << "FOUND STOP SIGN\n";
|
std::cerr << "FOUND STOP SIGN\n";
|
||||||
external_memory.external_stop_signs.push_back({id, result_node.stop_sign});
|
external_memory.external_stop_signs.push_back({id, result_node.stop_sign});
|
||||||
|
@ -22,8 +22,8 @@ namespace extractor
|
|||||||
static constexpr int SECOND_TO_DECISECOND = 10;
|
static constexpr int SECOND_TO_DECISECOND = 10;
|
||||||
|
|
||||||
void GraphCompressor::Compress(const std::unordered_set<NodeID> &barrier_nodes,
|
void GraphCompressor::Compress(const std::unordered_set<NodeID> &barrier_nodes,
|
||||||
const TrafficSignals &traffic_signals,
|
const TrafficFlowControlNodes &traffic_signals,
|
||||||
const StopSigns &stop_signs,
|
const TrafficFlowControlNodes &stop_signs,
|
||||||
ScriptingEnvironment &scripting_environment,
|
ScriptingEnvironment &scripting_environment,
|
||||||
std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
||||||
@ -210,11 +210,11 @@ void GraphCompressor::Compress(const std::unordered_set<NodeID> &barrier_nodes,
|
|||||||
rev_edge_data2.annotation_data, rev_edge_data1.annotation_data);
|
rev_edge_data2.annotation_data, rev_edge_data1.annotation_data);
|
||||||
|
|
||||||
// Add node penalty when compress edge crosses a traffic signal
|
// Add node penalty when compress edge crosses a traffic signal
|
||||||
const bool has_forward_signal = traffic_signals.HasSignal(node_u, node_v);
|
const bool has_forward_signal = traffic_signals.Has(node_u, node_v);
|
||||||
const bool has_reverse_signal = traffic_signals.HasSignal(node_w, node_v);
|
const bool has_reverse_signal = traffic_signals.Has(node_w, node_v);
|
||||||
|
|
||||||
const bool has_forward_stop_sign = stop_signs.HasSignal(node_u, node_v);
|
const bool has_forward_stop_sign = stop_signs.Has(node_u, node_v);
|
||||||
const bool has_reverse_stop_sign = stop_signs.HasSignal(node_w, node_v);
|
const bool has_reverse_stop_sign = stop_signs.Has(node_w, node_v);
|
||||||
|
|
||||||
// TODO: can we have a case when we have both traffic signal and stop sign? how should we handle it?
|
// TODO: can we have a case when we have both traffic signal and stop sign? how should we handle it?
|
||||||
EdgeDuration forward_node_duration_penalty = MAXIMAL_EDGE_DURATION;
|
EdgeDuration forward_node_duration_penalty = MAXIMAL_EDGE_DURATION;
|
||||||
@ -258,6 +258,8 @@ void GraphCompressor::Compress(const std::unordered_set<NodeID> &barrier_nodes,
|
|||||||
roads_on_the_left);
|
roads_on_the_left);
|
||||||
scripting_environment.ProcessTurn(extraction_turn);
|
scripting_environment.ProcessTurn(extraction_turn);
|
||||||
|
|
||||||
|
std::cerr << "HAS STOP SIGN = " << extraction_turn.has_stop_sign << " " << extraction_turn.duration << std::endl;
|
||||||
|
|
||||||
auto update_direction_penalty =
|
auto update_direction_penalty =
|
||||||
[&extraction_turn, weight_multiplier](bool signal,
|
[&extraction_turn, weight_multiplier](bool signal,
|
||||||
EdgeDuration &duration_penalty,
|
EdgeDuration &duration_penalty,
|
||||||
|
@ -20,8 +20,8 @@ NodeBasedGraphFactory::NodeBasedGraphFactory(
|
|||||||
ScriptingEnvironment &scripting_environment,
|
ScriptingEnvironment &scripting_environment,
|
||||||
std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
||||||
const TrafficSignals &traffic_signals,
|
const TrafficFlowControlNodes &traffic_signals,
|
||||||
const StopSigns &stop_signs,
|
const TrafficFlowControlNodes &stop_signs,
|
||||||
std::unordered_set<NodeID> &&barriers,
|
std::unordered_set<NodeID> &&barriers,
|
||||||
std::vector<util::Coordinate> &&coordinates,
|
std::vector<util::Coordinate> &&coordinates,
|
||||||
extractor::PackedOSMIDs &&osm_node_ids,
|
extractor::PackedOSMIDs &&osm_node_ids,
|
||||||
@ -76,8 +76,8 @@ void NodeBasedGraphFactory::BuildCompressedOutputGraph(const std::vector<NodeBas
|
|||||||
void NodeBasedGraphFactory::Compress(ScriptingEnvironment &scripting_environment,
|
void NodeBasedGraphFactory::Compress(ScriptingEnvironment &scripting_environment,
|
||||||
std::vector<TurnRestriction> &turn_restrictions,
|
std::vector<TurnRestriction> &turn_restrictions,
|
||||||
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
||||||
const TrafficSignals &traffic_signals,
|
const TrafficFlowControlNodes &traffic_signals,
|
||||||
const StopSigns &stop_signs)
|
const TrafficFlowControlNodes &stop_signs)
|
||||||
{
|
{
|
||||||
GraphCompressor graph_compressor;
|
GraphCompressor graph_compressor;
|
||||||
graph_compressor.Compress(barriers,
|
graph_compressor.Compress(barriers,
|
||||||
|
@ -284,35 +284,26 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
|
|||||||
[&context, &get_location_tag](const osmium::Node &node, const char *key) {
|
[&context, &get_location_tag](const osmium::Node &node, const char *key) {
|
||||||
return get_location_tag(context, node.location(), key);
|
return get_location_tag(context, node.location(), key);
|
||||||
});
|
});
|
||||||
|
// just for backward compatibility
|
||||||
|
// TODO: remove in v6
|
||||||
context.state.new_enum("traffic_lights",
|
context.state.new_enum("traffic_lights",
|
||||||
"none",
|
"none",
|
||||||
extractor::TrafficLightClass::NONE,
|
extractor::TrafficFlowControlNodeDirection::NONE,
|
||||||
"direction_all",
|
"direction_all",
|
||||||
extractor::TrafficLightClass::DIRECTION_ALL,
|
extractor::TrafficFlowControlNodeDirection::ALL,
|
||||||
"direction_forward",
|
"direction_forward",
|
||||||
extractor::TrafficLightClass::DIRECTION_FORWARD,
|
extractor::TrafficFlowControlNodeDirection::FORWARD,
|
||||||
"direction_reverse",
|
"direction_reverse",
|
||||||
extractor::TrafficLightClass::DIRECTION_REVERSE);
|
extractor::TrafficFlowControlNodeDirection::REVERSE);
|
||||||
context.state.new_enum("stop_sign",
|
context.state.new_enum("traffic_flow_control_direction",
|
||||||
"none",
|
"none",
|
||||||
extractor::StopSign::NONE,
|
extractor::TrafficFlowControlNodeDirection::NONE,
|
||||||
"direction_all",
|
"direction_all",
|
||||||
extractor::StopSign::DIRECTION_ALL,
|
extractor::TrafficFlowControlNodeDirection::ALL,
|
||||||
"direction_forward",
|
"direction_forward",
|
||||||
extractor::StopSign::DIRECTION_FORWARD,
|
extractor::TrafficFlowControlNodeDirection::FORWARD,
|
||||||
"direction_reverse",
|
"direction_reverse",
|
||||||
extractor::StopSign::DIRECTION_REVERSE);
|
extractor::TrafficFlowControlNodeDirection::REVERSE);
|
||||||
context.state.new_enum("give_way",
|
|
||||||
"none",
|
|
||||||
extractor::GiveWay::NONE,
|
|
||||||
"direction_all",
|
|
||||||
extractor::GiveWay::DIRECTION_ALL,
|
|
||||||
"direction_forward",
|
|
||||||
extractor::GiveWay::DIRECTION_FORWARD,
|
|
||||||
"direction_reverse",
|
|
||||||
extractor::GiveWay::DIRECTION_REVERSE);
|
|
||||||
|
|
||||||
context.state.new_usertype<ExtractionNode>(
|
context.state.new_usertype<ExtractionNode>(
|
||||||
"ResultNode",
|
"ResultNode",
|
||||||
"traffic_lights",
|
"traffic_lights",
|
||||||
@ -324,29 +315,29 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
|
|||||||
// state to the node is converted to the class enum
|
// state to the node is converted to the class enum
|
||||||
// TODO: Make a breaking API change and remove this option.
|
// TODO: Make a breaking API change and remove this option.
|
||||||
bool val = obj.as<bool>();
|
bool val = obj.as<bool>();
|
||||||
node.traffic_lights = (val) ? TrafficLightClass::DIRECTION_ALL
|
node.traffic_lights = (val) ? TrafficFlowControlNodeDirection::ALL
|
||||||
: TrafficLightClass::NONE;
|
: TrafficFlowControlNodeDirection::NONE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_ASSERT(obj.is<TrafficLightClass::Direction>());
|
BOOST_ASSERT(obj.is<TrafficFlowControlNodeDirection>());
|
||||||
{
|
{
|
||||||
TrafficLightClass::Direction val =
|
TrafficFlowControlNodeDirection val =
|
||||||
obj.as<TrafficLightClass::Direction>();
|
obj.as<TrafficFlowControlNodeDirection>();
|
||||||
node.traffic_lights = val;
|
node.traffic_lights = val;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
"stop_sign",
|
"stop_sign",
|
||||||
sol::property([](const ExtractionNode &node) { return node.stop_sign; },
|
sol::property([](const ExtractionNode &node) { return node.stop_sign; },
|
||||||
[](ExtractionNode &node, const sol::object &obj) {
|
[](ExtractionNode &node, const sol::object &obj) {
|
||||||
BOOST_ASSERT(obj.is<StopSign::Direction>());
|
BOOST_ASSERT(obj.is<TrafficFlowControlNodeDirection>());
|
||||||
node.stop_sign = obj.as<StopSign::Direction>();
|
node.stop_sign = obj.as<TrafficFlowControlNodeDirection>();
|
||||||
}),
|
}),
|
||||||
"give_way",
|
"give_way",
|
||||||
sol::property([](const ExtractionNode &node) { return node.give_way; },
|
sol::property([](const ExtractionNode &node) { return node.give_way; },
|
||||||
[](ExtractionNode &node, const sol::object &obj) {
|
[](ExtractionNode &node, const sol::object &obj) {
|
||||||
BOOST_ASSERT(obj.is<GiveWay::Direction>());
|
BOOST_ASSERT(obj.is<TrafficFlowControlNodeDirection>());
|
||||||
node.give_way = obj.as<GiveWay::Direction>();
|
node.give_way = obj.as<TrafficFlowControlNodeDirection>();
|
||||||
}),
|
}),
|
||||||
"barrier",
|
"barrier",
|
||||||
&ExtractionNode::barrier);
|
&ExtractionNode::barrier);
|
||||||
@ -1170,7 +1161,8 @@ void Sol2ScriptingEnvironment::ProcessTurn(ExtractionTurn &turn)
|
|||||||
else {
|
else {
|
||||||
// cap turn weight to max turn weight, which depend on weight precision
|
// cap turn weight to max turn weight, which depend on weight precision
|
||||||
turn.weight = std::min(turn.weight, context.properties.GetMaxTurnWeight());
|
turn.weight = std::min(turn.weight, context.properties.GetMaxTurnWeight());
|
||||||
std::cerr << "NO FALLBACK " << turn.weight << std::endl;
|
std::cerr << "NO FALLBACK " << turn.weight << " " << turn.duration << std::endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE(long_road_test)
|
|||||||
GraphCompressor compressor;
|
GraphCompressor compressor;
|
||||||
|
|
||||||
std::unordered_set<NodeID> barrier_nodes;
|
std::unordered_set<NodeID> barrier_nodes;
|
||||||
TrafficSignals traffic_lights;
|
TrafficFlowControlNodes traffic_lights;
|
||||||
std::vector<TurnRestriction> restrictions;
|
std::vector<TurnRestriction> restrictions;
|
||||||
std::vector<NodeBasedEdgeAnnotation> annotations(1);
|
std::vector<NodeBasedEdgeAnnotation> annotations(1);
|
||||||
CompressedEdgeContainer container;
|
CompressedEdgeContainer container;
|
||||||
@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(loop_test)
|
|||||||
GraphCompressor compressor;
|
GraphCompressor compressor;
|
||||||
|
|
||||||
std::unordered_set<NodeID> barrier_nodes;
|
std::unordered_set<NodeID> barrier_nodes;
|
||||||
TrafficSignals traffic_lights;
|
TrafficFlowControlNodes traffic_lights;
|
||||||
std::vector<TurnRestriction> restrictions;
|
std::vector<TurnRestriction> restrictions;
|
||||||
CompressedEdgeContainer container;
|
CompressedEdgeContainer container;
|
||||||
std::vector<NodeBasedEdgeAnnotation> annotations(1);
|
std::vector<NodeBasedEdgeAnnotation> annotations(1);
|
||||||
@ -174,7 +174,7 @@ BOOST_AUTO_TEST_CASE(t_intersection)
|
|||||||
GraphCompressor compressor;
|
GraphCompressor compressor;
|
||||||
|
|
||||||
std::unordered_set<NodeID> barrier_nodes;
|
std::unordered_set<NodeID> barrier_nodes;
|
||||||
TrafficSignals traffic_lights;
|
TrafficFlowControlNodes traffic_lights;
|
||||||
std::vector<NodeBasedEdgeAnnotation> annotations(1);
|
std::vector<NodeBasedEdgeAnnotation> annotations(1);
|
||||||
std::vector<TurnRestriction> restrictions;
|
std::vector<TurnRestriction> restrictions;
|
||||||
CompressedEdgeContainer container;
|
CompressedEdgeContainer container;
|
||||||
@ -217,7 +217,7 @@ BOOST_AUTO_TEST_CASE(street_name_changes)
|
|||||||
GraphCompressor compressor;
|
GraphCompressor compressor;
|
||||||
|
|
||||||
std::unordered_set<NodeID> barrier_nodes;
|
std::unordered_set<NodeID> barrier_nodes;
|
||||||
TrafficSignals traffic_lights;
|
TrafficFlowControlNodes traffic_lights;
|
||||||
std::vector<NodeBasedEdgeAnnotation> annotations(2);
|
std::vector<NodeBasedEdgeAnnotation> annotations(2);
|
||||||
std::vector<TurnRestriction> restrictions;
|
std::vector<TurnRestriction> restrictions;
|
||||||
CompressedEdgeContainer container;
|
CompressedEdgeContainer container;
|
||||||
@ -255,7 +255,7 @@ BOOST_AUTO_TEST_CASE(direction_changes)
|
|||||||
GraphCompressor compressor;
|
GraphCompressor compressor;
|
||||||
|
|
||||||
std::unordered_set<NodeID> barrier_nodes;
|
std::unordered_set<NodeID> barrier_nodes;
|
||||||
TrafficSignals traffic_lights;
|
TrafficFlowControlNodes traffic_lights;
|
||||||
std::vector<NodeBasedEdgeAnnotation> annotations(1);
|
std::vector<NodeBasedEdgeAnnotation> annotations(1);
|
||||||
std::vector<TurnRestriction> restrictions;
|
std::vector<TurnRestriction> restrictions;
|
||||||
CompressedEdgeContainer container;
|
CompressedEdgeContainer container;
|
||||||
|
@ -19,7 +19,7 @@ using Graph = util::NodeBasedDynamicGraph;
|
|||||||
BOOST_AUTO_TEST_CASE(simple_intersection_connectivity)
|
BOOST_AUTO_TEST_CASE(simple_intersection_connectivity)
|
||||||
{
|
{
|
||||||
std::unordered_set<NodeID> barrier_nodes{6};
|
std::unordered_set<NodeID> barrier_nodes{6};
|
||||||
TrafficSignals traffic_lights;
|
TrafficFlowControlNodes traffic_lights;
|
||||||
std::vector<NodeBasedEdgeAnnotation> annotations{
|
std::vector<NodeBasedEdgeAnnotation> annotations{
|
||||||
{EMPTY_NAMEID, 0, INAVLID_CLASS_DATA, TRAVEL_MODE_DRIVING, false},
|
{EMPTY_NAMEID, 0, INAVLID_CLASS_DATA, TRAVEL_MODE_DRIVING, false},
|
||||||
{EMPTY_NAMEID, 1, INAVLID_CLASS_DATA, TRAVEL_MODE_DRIVING, false}};
|
{EMPTY_NAMEID, 1, INAVLID_CLASS_DATA, TRAVEL_MODE_DRIVING, false}};
|
||||||
@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(simple_intersection_connectivity)
|
|||||||
BOOST_AUTO_TEST_CASE(roundabout_intersection_connectivity)
|
BOOST_AUTO_TEST_CASE(roundabout_intersection_connectivity)
|
||||||
{
|
{
|
||||||
std::unordered_set<NodeID> barrier_nodes;
|
std::unordered_set<NodeID> barrier_nodes;
|
||||||
TrafficSignals traffic_lights;
|
TrafficFlowControlNodes traffic_lights;
|
||||||
std::vector<NodeBasedEdgeAnnotation> annotations;
|
std::vector<NodeBasedEdgeAnnotation> annotations;
|
||||||
std::vector<TurnRestriction> restrictions;
|
std::vector<TurnRestriction> restrictions;
|
||||||
CompressedEdgeContainer container;
|
CompressedEdgeContainer container;
|
||||||
@ -259,7 +259,7 @@ BOOST_AUTO_TEST_CASE(roundabout_intersection_connectivity)
|
|||||||
BOOST_AUTO_TEST_CASE(skip_degree_two_nodes)
|
BOOST_AUTO_TEST_CASE(skip_degree_two_nodes)
|
||||||
{
|
{
|
||||||
std::unordered_set<NodeID> barrier_nodes{1};
|
std::unordered_set<NodeID> barrier_nodes{1};
|
||||||
TrafficSignals traffic_lights = {{2}, {}};
|
TrafficFlowControlNodes traffic_lights = {{2}, {}};
|
||||||
std::vector<NodeBasedEdgeAnnotation> annotations(1);
|
std::vector<NodeBasedEdgeAnnotation> annotations(1);
|
||||||
std::vector<TurnRestriction> restrictions;
|
std::vector<TurnRestriction> restrictions;
|
||||||
CompressedEdgeContainer container;
|
CompressedEdgeContainer container;
|
||||||
|
Loading…
Reference in New Issue
Block a user