add support for junction=circular, allowing named circular junctions to be treated as rotaries

This commit is contained in:
Moritz Kobitzsch
2016-11-24 13:29:17 +01:00
parent 4636aaabfe
commit 12d58ace10
14 changed files with 433 additions and 428 deletions
+2
View File
@@ -45,6 +45,7 @@ struct ExtractionWay
backward_speed = -1;
duration = -1;
roundabout = false;
circular = false;
is_startpoint = true;
is_access_restricted = false;
name.clear();
@@ -89,6 +90,7 @@ struct ExtractionWay
std::string turn_lanes_forward;
std::string turn_lanes_backward;
bool roundabout;
bool circular;
bool is_access_restricted;
bool is_startpoint;
TravelMode forward_travel_mode : 4;
+20 -15
View File
@@ -43,11 +43,12 @@ struct InternalExtractorEdge
MIN_OSM_NODEID,
0,
0,
false,
false,
false,
false,
true,
false, // forward
false, // backward
false, // roundabout
false, // circular
false, // access restricted
true, // can be startpoint
TRAVEL_MODE_INACCESSIBLE,
false,
guidance::TurnLaneType::empty,
@@ -62,6 +63,7 @@ struct InternalExtractorEdge
bool forward,
bool backward,
bool roundabout,
bool circular,
bool access_restricted,
bool startpoint,
TravelMode travel_mode,
@@ -75,6 +77,7 @@ struct InternalExtractorEdge
forward,
backward,
roundabout,
circular,
access_restricted,
startpoint,
travel_mode,
@@ -99,11 +102,12 @@ struct InternalExtractorEdge
MIN_OSM_NODEID,
0,
WeightData(),
false,
false,
false,
false,
true,
false, // forward
false, // backward
false, // roundabout
false, // circular
false, // access restricted
true, // can be startpoint
TRAVEL_MODE_INACCESSIBLE,
false,
INVALID_LANE_DESCRIPTIONID,
@@ -115,11 +119,12 @@ struct InternalExtractorEdge
MAX_OSM_NODEID,
SPECIAL_NODEID,
WeightData(),
false,
false,
false,
false,
true,
false, // forward
false, // backward
false, // roundabout
false, // circular
false, // access restricted
true, // can be startpoint
TRAVEL_MODE_INACCESSIBLE,
false,
INVALID_LANE_DESCRIPTIONID,
+8 -2
View File
@@ -22,6 +22,7 @@ struct NodeBasedEdge
bool forward,
bool backward,
bool roundabout,
bool circular,
bool access_restricted,
bool startpoint,
TravelMode travel_mode,
@@ -38,6 +39,7 @@ struct NodeBasedEdge
bool forward : 1;
bool backward : 1;
bool roundabout : 1;
bool circular : 1;
bool access_restricted : 1;
bool startpoint : 1;
bool is_split : 1;
@@ -55,6 +57,7 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
bool forward,
bool backward,
bool roundabout,
bool circular,
bool access_restricted,
bool startpoint,
TravelMode travel_mode,
@@ -70,7 +73,7 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
inline NodeBasedEdge::NodeBasedEdge()
: source(SPECIAL_NODEID), target(SPECIAL_NODEID), name_id(0), weight(0), forward(false),
backward(false), roundabout(false), access_restricted(false), startpoint(true),
backward(false), roundabout(false), circular(false), access_restricted(false), startpoint(true),
is_split(false), travel_mode(false), lane_description_id(INVALID_LANE_DESCRIPTIONID)
{
}
@@ -82,6 +85,7 @@ inline NodeBasedEdge::NodeBasedEdge(NodeID source,
bool forward,
bool backward,
bool roundabout,
bool circular,
bool access_restricted,
bool startpoint,
TravelMode travel_mode,
@@ -89,7 +93,7 @@ inline NodeBasedEdge::NodeBasedEdge(NodeID source,
const LaneDescriptionID lane_description_id,
guidance::RoadClassification road_classification)
: source(source), target(target), name_id(name_id), weight(weight), forward(forward),
backward(backward), roundabout(roundabout), access_restricted(access_restricted),
backward(backward), roundabout(roundabout), circular(circular), access_restricted(access_restricted),
startpoint(startpoint), is_split(is_split), travel_mode(travel_mode),
lane_description_id(lane_description_id), road_classification(std::move(road_classification))
{
@@ -119,6 +123,7 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
bool forward,
bool backward,
bool roundabout,
bool circular,
bool access_restricted,
bool startpoint,
TravelMode travel_mode,
@@ -132,6 +137,7 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
forward,
backward,
roundabout,
circular,
access_restricted,
startpoint,
travel_mode,
+8 -3
View File
@@ -20,7 +20,7 @@ struct NodeBasedEdgeData
NodeBasedEdgeData()
: distance(INVALID_EDGE_WEIGHT), edge_id(SPECIAL_NODEID),
name_id(std::numeric_limits<unsigned>::max()), access_restricted(false), reversed(false),
roundabout(false), travel_mode(TRAVEL_MODE_INACCESSIBLE),
roundabout(false), circular(false), travel_mode(TRAVEL_MODE_INACCESSIBLE),
lane_description_id(INVALID_LANE_DESCRIPTIONID)
{
}
@@ -31,12 +31,14 @@ struct NodeBasedEdgeData
bool access_restricted,
bool reversed,
bool roundabout,
bool circular,
bool startpoint,
extractor::TravelMode travel_mode,
const LaneDescriptionID lane_description_id)
: distance(distance), edge_id(edge_id), name_id(name_id),
access_restricted(access_restricted), reversed(reversed), roundabout(roundabout),
startpoint(startpoint), travel_mode(travel_mode), lane_description_id(lane_description_id)
circular(circular), startpoint(startpoint), travel_mode(travel_mode),
lane_description_id(lane_description_id)
{
}
@@ -46,6 +48,7 @@ struct NodeBasedEdgeData
bool access_restricted : 1;
bool reversed : 1;
bool roundabout : 1;
bool circular : 1;
bool startpoint : 1;
extractor::TravelMode travel_mode : 4;
LaneDescriptionID lane_description_id;
@@ -54,7 +57,8 @@ struct NodeBasedEdgeData
bool IsCompatibleTo(const NodeBasedEdgeData &other) const
{
return (reversed == other.reversed) && (roundabout == other.roundabout) &&
(startpoint == other.startpoint) && (access_restricted == other.access_restricted) &&
(circular == other.circular) && (startpoint == other.startpoint) &&
(access_restricted == other.access_restricted) &&
(travel_mode == other.travel_mode) &&
(road_classification == other.road_classification);
}
@@ -82,6 +86,7 @@ NodeBasedDynamicGraphFromEdges(NodeID number_of_nodes,
BOOST_ASSERT(output_edge.data.distance > 0);
output_edge.data.roundabout = input_edge.roundabout;
output_edge.data.circular = input_edge.circular;
output_edge.data.name_id = input_edge.name_id;
output_edge.data.access_restricted = input_edge.access_restricted;
output_edge.data.travel_mode = input_edge.travel_mode;