Use driving_side tag of location-dependent data and OSM ways

This commit is contained in:
Michael Krasnyk
2017-08-07 23:39:34 +02:00
parent c9673741de
commit af3f0a4782
8 changed files with 55 additions and 25 deletions
+2
View File
@@ -61,6 +61,7 @@ struct ExtractionWay
road_classification = guidance::RoadClassification();
backward_restricted = false;
forward_restricted = false;
is_left_hand_driving = false;
}
// wrappers to allow assigning nil (nullptr) to string values
@@ -114,6 +115,7 @@ struct ExtractionWay
bool is_startpoint : 1;
bool forward_restricted : 1;
bool backward_restricted : 1;
bool is_left_hand_driving : 1;
};
}
}
@@ -70,6 +70,7 @@ struct InternalExtractorEdge
false, // circular
true, // can be startpoint
false, // local access only
false, // is_left_hand_driving
false, // split edge
TRAVEL_MODE_INACCESSIBLE,
0,
@@ -90,6 +91,7 @@ struct InternalExtractorEdge
bool circular,
bool startpoint,
bool restricted,
bool is_left_hand_driving,
bool is_split,
TravelMode travel_mode,
ClassData classes,
@@ -107,6 +109,7 @@ struct InternalExtractorEdge
circular,
startpoint,
restricted,
is_left_hand_driving,
is_split,
travel_mode,
classes,
@@ -140,6 +143,7 @@ struct InternalExtractorEdge
false, // circular
true, // can be startpoint
false, // local access only
false, // is_left_hand_driving
false, // split edge
TRAVEL_MODE_INACCESSIBLE,
0,
@@ -160,6 +164,7 @@ struct InternalExtractorEdge
false, // circular
true, // can be startpoint
false, // local access only
false, // is_left_hand_driving
false, // split edge
TRAVEL_MODE_INACCESSIBLE,
0,
+11 -5
View File
@@ -27,6 +27,7 @@ struct NodeBasedEdge
bool circular,
bool startpoint,
bool restricted,
bool is_left_hand_driving,
bool is_split,
TravelMode travel_mode,
ClassData classes,
@@ -46,6 +47,7 @@ struct NodeBasedEdge
std::uint8_t circular : 1; // 1
std::uint8_t startpoint : 1; // 1
std::uint8_t restricted : 1; // 1
std::uint8_t is_left_hand_driving : 1; // 1
std::uint8_t is_split : 1; // 1
TravelMode travel_mode : 4; // 4
ClassData classes; // 8 1
@@ -66,6 +68,7 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
bool circular,
bool startpoint,
bool restricted,
bool is_left_hand_driving,
bool is_split,
TravelMode travel_mode,
ClassData classes,
@@ -81,8 +84,8 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
inline NodeBasedEdge::NodeBasedEdge()
: source(SPECIAL_NODEID), target(SPECIAL_NODEID), name_id(0), weight(0), duration(0),
forward(false), backward(false), roundabout(false), circular(false), startpoint(true),
restricted(false), is_split(false), travel_mode(TRAVEL_MODE_INACCESSIBLE),
lane_description_id(INVALID_LANE_DESCRIPTIONID)
restricted(false), is_left_hand_driving(false), is_split(false),
travel_mode(TRAVEL_MODE_INACCESSIBLE), lane_description_id(INVALID_LANE_DESCRIPTIONID)
{
}
@@ -97,6 +100,7 @@ inline NodeBasedEdge::NodeBasedEdge(NodeID source,
bool circular,
bool startpoint,
bool restricted,
bool is_left_hand_driving,
bool is_split,
TravelMode travel_mode,
ClassData classes,
@@ -104,9 +108,9 @@ inline NodeBasedEdge::NodeBasedEdge(NodeID source,
guidance::RoadClassification road_classification)
: source(source), target(target), name_id(name_id), weight(weight), duration(duration),
forward(forward), backward(backward), roundabout(roundabout), circular(circular),
startpoint(startpoint), restricted(restricted), is_split(is_split), travel_mode(travel_mode),
classes(classes), lane_description_id(lane_description_id),
road_classification(std::move(road_classification))
startpoint(startpoint), restricted(restricted), is_left_hand_driving(is_left_hand_driving),
is_split(is_split), travel_mode(travel_mode), classes(classes),
lane_description_id(lane_description_id), road_classification(std::move(road_classification))
{
}
@@ -138,6 +142,7 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
bool circular,
bool startpoint,
bool restricted,
bool is_left_hand_driving,
bool is_split,
TravelMode travel_mode,
ClassData classes,
@@ -154,6 +159,7 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
circular,
startpoint,
restricted,
is_left_hand_driving,
is_split,
travel_mode,
classes,
+9 -5
View File
@@ -21,8 +21,8 @@ struct NodeBasedEdgeData
NodeBasedEdgeData()
: weight(INVALID_EDGE_WEIGHT), duration(INVALID_EDGE_WEIGHT), edge_id(SPECIAL_NODEID),
name_id(std::numeric_limits<unsigned>::max()), reversed(false), roundabout(false),
circular(false), travel_mode(TRAVEL_MODE_INACCESSIBLE),
lane_description_id(INVALID_LANE_DESCRIPTIONID)
circular(false), startpoint(false), restricted(false), is_left_hand_driving(false),
travel_mode(TRAVEL_MODE_INACCESSIBLE), lane_description_id(INVALID_LANE_DESCRIPTIONID)
{
}
@@ -35,13 +35,14 @@ struct NodeBasedEdgeData
bool circular,
bool startpoint,
bool restricted,
bool is_left_hand_driving,
extractor::TravelMode travel_mode,
extractor::ClassData classes,
const LaneDescriptionID lane_description_id)
: weight(weight), duration(duration), edge_id(edge_id), name_id(name_id),
reversed(reversed), roundabout(roundabout), circular(circular), startpoint(startpoint),
restricted(restricted), travel_mode(travel_mode), classes(classes),
lane_description_id(lane_description_id)
restricted(restricted), is_left_hand_driving(is_left_hand_driving),
travel_mode(travel_mode), classes(classes), lane_description_id(lane_description_id)
{
}
@@ -54,6 +55,7 @@ struct NodeBasedEdgeData
bool circular : 1;
bool startpoint : 1;
bool restricted : 1;
bool is_left_hand_driving : 1;
extractor::TravelMode travel_mode : 4;
extractor::ClassData classes;
LaneDescriptionID lane_description_id;
@@ -65,7 +67,8 @@ struct NodeBasedEdgeData
(circular == other.circular) && (startpoint == other.startpoint) &&
(travel_mode == other.travel_mode) && (classes == other.classes) &&
(road_classification == other.road_classification) &&
(restricted == other.restricted);
(restricted == other.restricted) &&
(is_left_hand_driving == other.is_left_hand_driving);
}
bool CanCombineWith(const NodeBasedEdgeData &other) const
@@ -96,6 +99,7 @@ NodeBasedDynamicGraphFromEdges(NodeID number_of_nodes,
output_edge.data.classes = input_edge.classes;
output_edge.data.startpoint = input_edge.startpoint;
output_edge.data.restricted = input_edge.restricted;
output_edge.data.is_left_hand_driving = input_edge.is_left_hand_driving;
output_edge.data.road_classification = input_edge.road_classification;
output_edge.data.lane_description_id = input_edge.lane_description_id;