Use driving_side tag of location-dependent data and OSM ways
This commit is contained in:
parent
c9673741de
commit
af3f0a4782
@ -61,6 +61,7 @@ struct ExtractionWay
|
|||||||
road_classification = guidance::RoadClassification();
|
road_classification = guidance::RoadClassification();
|
||||||
backward_restricted = false;
|
backward_restricted = false;
|
||||||
forward_restricted = false;
|
forward_restricted = false;
|
||||||
|
is_left_hand_driving = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// wrappers to allow assigning nil (nullptr) to string values
|
// wrappers to allow assigning nil (nullptr) to string values
|
||||||
@ -114,6 +115,7 @@ struct ExtractionWay
|
|||||||
bool is_startpoint : 1;
|
bool is_startpoint : 1;
|
||||||
bool forward_restricted : 1;
|
bool forward_restricted : 1;
|
||||||
bool backward_restricted : 1;
|
bool backward_restricted : 1;
|
||||||
|
bool is_left_hand_driving : 1;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ struct InternalExtractorEdge
|
|||||||
false, // circular
|
false, // circular
|
||||||
true, // can be startpoint
|
true, // can be startpoint
|
||||||
false, // local access only
|
false, // local access only
|
||||||
|
false, // is_left_hand_driving
|
||||||
false, // split edge
|
false, // split edge
|
||||||
TRAVEL_MODE_INACCESSIBLE,
|
TRAVEL_MODE_INACCESSIBLE,
|
||||||
0,
|
0,
|
||||||
@ -90,6 +91,7 @@ struct InternalExtractorEdge
|
|||||||
bool circular,
|
bool circular,
|
||||||
bool startpoint,
|
bool startpoint,
|
||||||
bool restricted,
|
bool restricted,
|
||||||
|
bool is_left_hand_driving,
|
||||||
bool is_split,
|
bool is_split,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
ClassData classes,
|
ClassData classes,
|
||||||
@ -107,6 +109,7 @@ struct InternalExtractorEdge
|
|||||||
circular,
|
circular,
|
||||||
startpoint,
|
startpoint,
|
||||||
restricted,
|
restricted,
|
||||||
|
is_left_hand_driving,
|
||||||
is_split,
|
is_split,
|
||||||
travel_mode,
|
travel_mode,
|
||||||
classes,
|
classes,
|
||||||
@ -140,6 +143,7 @@ struct InternalExtractorEdge
|
|||||||
false, // circular
|
false, // circular
|
||||||
true, // can be startpoint
|
true, // can be startpoint
|
||||||
false, // local access only
|
false, // local access only
|
||||||
|
false, // is_left_hand_driving
|
||||||
false, // split edge
|
false, // split edge
|
||||||
TRAVEL_MODE_INACCESSIBLE,
|
TRAVEL_MODE_INACCESSIBLE,
|
||||||
0,
|
0,
|
||||||
@ -160,6 +164,7 @@ struct InternalExtractorEdge
|
|||||||
false, // circular
|
false, // circular
|
||||||
true, // can be startpoint
|
true, // can be startpoint
|
||||||
false, // local access only
|
false, // local access only
|
||||||
|
false, // is_left_hand_driving
|
||||||
false, // split edge
|
false, // split edge
|
||||||
TRAVEL_MODE_INACCESSIBLE,
|
TRAVEL_MODE_INACCESSIBLE,
|
||||||
0,
|
0,
|
||||||
|
@ -27,6 +27,7 @@ struct NodeBasedEdge
|
|||||||
bool circular,
|
bool circular,
|
||||||
bool startpoint,
|
bool startpoint,
|
||||||
bool restricted,
|
bool restricted,
|
||||||
|
bool is_left_hand_driving,
|
||||||
bool is_split,
|
bool is_split,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
ClassData classes,
|
ClassData classes,
|
||||||
@ -46,6 +47,7 @@ struct NodeBasedEdge
|
|||||||
std::uint8_t circular : 1; // 1
|
std::uint8_t circular : 1; // 1
|
||||||
std::uint8_t startpoint : 1; // 1
|
std::uint8_t startpoint : 1; // 1
|
||||||
std::uint8_t restricted : 1; // 1
|
std::uint8_t restricted : 1; // 1
|
||||||
|
std::uint8_t is_left_hand_driving : 1; // 1
|
||||||
std::uint8_t is_split : 1; // 1
|
std::uint8_t is_split : 1; // 1
|
||||||
TravelMode travel_mode : 4; // 4
|
TravelMode travel_mode : 4; // 4
|
||||||
ClassData classes; // 8 1
|
ClassData classes; // 8 1
|
||||||
@ -66,6 +68,7 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
|
|||||||
bool circular,
|
bool circular,
|
||||||
bool startpoint,
|
bool startpoint,
|
||||||
bool restricted,
|
bool restricted,
|
||||||
|
bool is_left_hand_driving,
|
||||||
bool is_split,
|
bool is_split,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
ClassData classes,
|
ClassData classes,
|
||||||
@ -81,8 +84,8 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
|
|||||||
inline NodeBasedEdge::NodeBasedEdge()
|
inline NodeBasedEdge::NodeBasedEdge()
|
||||||
: source(SPECIAL_NODEID), target(SPECIAL_NODEID), name_id(0), weight(0), duration(0),
|
: source(SPECIAL_NODEID), target(SPECIAL_NODEID), name_id(0), weight(0), duration(0),
|
||||||
forward(false), backward(false), roundabout(false), circular(false), startpoint(true),
|
forward(false), backward(false), roundabout(false), circular(false), startpoint(true),
|
||||||
restricted(false), is_split(false), travel_mode(TRAVEL_MODE_INACCESSIBLE),
|
restricted(false), is_left_hand_driving(false), is_split(false),
|
||||||
lane_description_id(INVALID_LANE_DESCRIPTIONID)
|
travel_mode(TRAVEL_MODE_INACCESSIBLE), lane_description_id(INVALID_LANE_DESCRIPTIONID)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,6 +100,7 @@ inline NodeBasedEdge::NodeBasedEdge(NodeID source,
|
|||||||
bool circular,
|
bool circular,
|
||||||
bool startpoint,
|
bool startpoint,
|
||||||
bool restricted,
|
bool restricted,
|
||||||
|
bool is_left_hand_driving,
|
||||||
bool is_split,
|
bool is_split,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
ClassData classes,
|
ClassData classes,
|
||||||
@ -104,9 +108,9 @@ inline NodeBasedEdge::NodeBasedEdge(NodeID source,
|
|||||||
guidance::RoadClassification road_classification)
|
guidance::RoadClassification road_classification)
|
||||||
: source(source), target(target), name_id(name_id), weight(weight), duration(duration),
|
: source(source), target(target), name_id(name_id), weight(weight), duration(duration),
|
||||||
forward(forward), backward(backward), roundabout(roundabout), circular(circular),
|
forward(forward), backward(backward), roundabout(roundabout), circular(circular),
|
||||||
startpoint(startpoint), restricted(restricted), is_split(is_split), travel_mode(travel_mode),
|
startpoint(startpoint), restricted(restricted), is_left_hand_driving(is_left_hand_driving),
|
||||||
classes(classes), lane_description_id(lane_description_id),
|
is_split(is_split), travel_mode(travel_mode), classes(classes),
|
||||||
road_classification(std::move(road_classification))
|
lane_description_id(lane_description_id), road_classification(std::move(road_classification))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,6 +142,7 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
|
|||||||
bool circular,
|
bool circular,
|
||||||
bool startpoint,
|
bool startpoint,
|
||||||
bool restricted,
|
bool restricted,
|
||||||
|
bool is_left_hand_driving,
|
||||||
bool is_split,
|
bool is_split,
|
||||||
TravelMode travel_mode,
|
TravelMode travel_mode,
|
||||||
ClassData classes,
|
ClassData classes,
|
||||||
@ -154,6 +159,7 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
|
|||||||
circular,
|
circular,
|
||||||
startpoint,
|
startpoint,
|
||||||
restricted,
|
restricted,
|
||||||
|
is_left_hand_driving,
|
||||||
is_split,
|
is_split,
|
||||||
travel_mode,
|
travel_mode,
|
||||||
classes,
|
classes,
|
||||||
|
@ -21,8 +21,8 @@ struct NodeBasedEdgeData
|
|||||||
NodeBasedEdgeData()
|
NodeBasedEdgeData()
|
||||||
: weight(INVALID_EDGE_WEIGHT), duration(INVALID_EDGE_WEIGHT), edge_id(SPECIAL_NODEID),
|
: weight(INVALID_EDGE_WEIGHT), duration(INVALID_EDGE_WEIGHT), edge_id(SPECIAL_NODEID),
|
||||||
name_id(std::numeric_limits<unsigned>::max()), reversed(false), roundabout(false),
|
name_id(std::numeric_limits<unsigned>::max()), reversed(false), roundabout(false),
|
||||||
circular(false), travel_mode(TRAVEL_MODE_INACCESSIBLE),
|
circular(false), startpoint(false), restricted(false), is_left_hand_driving(false),
|
||||||
lane_description_id(INVALID_LANE_DESCRIPTIONID)
|
travel_mode(TRAVEL_MODE_INACCESSIBLE), lane_description_id(INVALID_LANE_DESCRIPTIONID)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,13 +35,14 @@ struct NodeBasedEdgeData
|
|||||||
bool circular,
|
bool circular,
|
||||||
bool startpoint,
|
bool startpoint,
|
||||||
bool restricted,
|
bool restricted,
|
||||||
|
bool is_left_hand_driving,
|
||||||
extractor::TravelMode travel_mode,
|
extractor::TravelMode travel_mode,
|
||||||
extractor::ClassData classes,
|
extractor::ClassData classes,
|
||||||
const LaneDescriptionID lane_description_id)
|
const LaneDescriptionID lane_description_id)
|
||||||
: weight(weight), duration(duration), edge_id(edge_id), name_id(name_id),
|
: weight(weight), duration(duration), edge_id(edge_id), name_id(name_id),
|
||||||
reversed(reversed), roundabout(roundabout), circular(circular), startpoint(startpoint),
|
reversed(reversed), roundabout(roundabout), circular(circular), startpoint(startpoint),
|
||||||
restricted(restricted), travel_mode(travel_mode), classes(classes),
|
restricted(restricted), is_left_hand_driving(is_left_hand_driving),
|
||||||
lane_description_id(lane_description_id)
|
travel_mode(travel_mode), classes(classes), lane_description_id(lane_description_id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +55,7 @@ struct NodeBasedEdgeData
|
|||||||
bool circular : 1;
|
bool circular : 1;
|
||||||
bool startpoint : 1;
|
bool startpoint : 1;
|
||||||
bool restricted : 1;
|
bool restricted : 1;
|
||||||
|
bool is_left_hand_driving : 1;
|
||||||
extractor::TravelMode travel_mode : 4;
|
extractor::TravelMode travel_mode : 4;
|
||||||
extractor::ClassData classes;
|
extractor::ClassData classes;
|
||||||
LaneDescriptionID lane_description_id;
|
LaneDescriptionID lane_description_id;
|
||||||
@ -65,7 +67,8 @@ struct NodeBasedEdgeData
|
|||||||
(circular == other.circular) && (startpoint == other.startpoint) &&
|
(circular == other.circular) && (startpoint == other.startpoint) &&
|
||||||
(travel_mode == other.travel_mode) && (classes == other.classes) &&
|
(travel_mode == other.travel_mode) && (classes == other.classes) &&
|
||||||
(road_classification == other.road_classification) &&
|
(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
|
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.classes = input_edge.classes;
|
||||||
output_edge.data.startpoint = input_edge.startpoint;
|
output_edge.data.startpoint = input_edge.startpoint;
|
||||||
output_edge.data.restricted = input_edge.restricted;
|
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.road_classification = input_edge.road_classification;
|
||||||
output_edge.data.lane_description_id = input_edge.lane_description_id;
|
output_edge.data.lane_description_id = input_edge.lane_description_id;
|
||||||
|
|
||||||
|
@ -406,6 +406,7 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti
|
|||||||
parsed_way.circular,
|
parsed_way.circular,
|
||||||
parsed_way.is_startpoint,
|
parsed_way.is_startpoint,
|
||||||
parsed_way.forward_restricted,
|
parsed_way.forward_restricted,
|
||||||
|
parsed_way.is_left_hand_driving,
|
||||||
split_edge,
|
split_edge,
|
||||||
parsed_way.forward_travel_mode,
|
parsed_way.forward_travel_mode,
|
||||||
forward_classes,
|
forward_classes,
|
||||||
@ -433,6 +434,7 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti
|
|||||||
parsed_way.circular,
|
parsed_way.circular,
|
||||||
parsed_way.is_startpoint,
|
parsed_way.is_startpoint,
|
||||||
parsed_way.backward_restricted,
|
parsed_way.backward_restricted,
|
||||||
|
parsed_way.is_left_hand_driving,
|
||||||
split_edge,
|
split_edge,
|
||||||
parsed_way.backward_travel_mode,
|
parsed_way.backward_travel_mode,
|
||||||
backward_classes,
|
backward_classes,
|
||||||
|
@ -401,7 +401,10 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
|
|||||||
[](ExtractionWay &way, bool flag) { way.forward_restricted = flag; }),
|
[](ExtractionWay &way, bool flag) { way.forward_restricted = flag; }),
|
||||||
"backward_restricted",
|
"backward_restricted",
|
||||||
sol::property([](const ExtractionWay &way) { return way.backward_restricted; },
|
sol::property([](const ExtractionWay &way) { return way.backward_restricted; },
|
||||||
[](ExtractionWay &way, bool flag) { way.backward_restricted = flag; }));
|
[](ExtractionWay &way, bool flag) { way.backward_restricted = flag; }),
|
||||||
|
"is_left_hand_driving",
|
||||||
|
sol::property([](const ExtractionWay &way) { return way.is_left_hand_driving; },
|
||||||
|
[](ExtractionWay &way, bool flag) { way.is_left_hand_driving = flag; }));
|
||||||
|
|
||||||
context.state.new_usertype<ExtractionRelation>(
|
context.state.new_usertype<ExtractionRelation>(
|
||||||
"ExtractionRelation",
|
"ExtractionRelation",
|
||||||
|
@ -268,6 +268,11 @@
|
|||||||
"object_types": [ "way" ],
|
"object_types": [ "way" ],
|
||||||
"description": "Name of road for navigation instructions."
|
"description": "Name of road for navigation instructions."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "driving_side",
|
||||||
|
"object_types": [ "way" ],
|
||||||
|
"description": "Driving side in all bidirectional traffic."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "turn:lanes",
|
"key": "turn:lanes",
|
||||||
"object_types": [ "way" ],
|
"object_types": [ "way" ],
|
||||||
|
@ -28,20 +28,23 @@ inline InputEdge MakeUnitEdge(const NodeID from, const NodeID to)
|
|||||||
{
|
{
|
||||||
// src, tgt, dist, edge_id, name_id, fwd, bkwd, roundabout, circular, startpoint, local access,
|
// src, tgt, dist, edge_id, name_id, fwd, bkwd, roundabout, circular, startpoint, local access,
|
||||||
// split edge, travel_mode
|
// split edge, travel_mode
|
||||||
return {from,
|
return {
|
||||||
to,
|
from, // source
|
||||||
1,
|
to, // target
|
||||||
SPECIAL_EDGEID,
|
1, // weight
|
||||||
0,
|
1, // duration
|
||||||
0,
|
SPECIAL_EDGEID, // edge_id
|
||||||
false,
|
0, // name_id
|
||||||
false,
|
false, // reversed
|
||||||
false,
|
false, // roundabout
|
||||||
false,
|
false, // circular
|
||||||
true,
|
false, // startpoint
|
||||||
TRAVEL_MODE_INACCESSIBLE,
|
false, // is_left_hand_driving
|
||||||
0,
|
true, // split edge
|
||||||
INVALID_LANE_DESCRIPTIONID};
|
TRAVEL_MODE_INACCESSIBLE, // travel_mode
|
||||||
|
0, // classes
|
||||||
|
INVALID_LANE_DESCRIPTIONID // lane_description_id
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user