expose data about turning onto restricted roads to turn function
This commit is contained in:
committed by
Patrick Niklaus
parent
c42478f0ee
commit
3aba2bc2d0
@@ -17,7 +17,8 @@ struct ExtractionTurn
|
||||
ExtractionTurn(const guidance::ConnectedRoad &turn, bool has_traffic_light)
|
||||
: angle(180. - turn.angle), turn_type(turn.instruction.type),
|
||||
direction_modifier(turn.instruction.direction_modifier),
|
||||
has_traffic_light(has_traffic_light), weight(0.), duration(0.)
|
||||
has_traffic_light(has_traffic_light), weight(0.), duration(0.), source_restricted(false),
|
||||
target_restricted(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -27,6 +28,8 @@ struct ExtractionTurn
|
||||
const bool has_traffic_light;
|
||||
double weight;
|
||||
double duration;
|
||||
bool source_restricted;
|
||||
bool target_restricted;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,8 @@ struct ExtractionWay
|
||||
turn_lanes_forward.clear();
|
||||
turn_lanes_backward.clear();
|
||||
road_classification = guidance::RoadClassification();
|
||||
backward_restricted = false;
|
||||
forward_restricted = false;
|
||||
}
|
||||
|
||||
// These accessors exists because it's not possible to take the address of a bitfield,
|
||||
@@ -106,6 +108,8 @@ struct ExtractionWay
|
||||
bool roundabout;
|
||||
bool circular;
|
||||
bool is_startpoint;
|
||||
bool backward_restricted;
|
||||
bool forward_restricted;
|
||||
TravelMode forward_travel_mode : 4;
|
||||
TravelMode backward_travel_mode : 4;
|
||||
guidance::RoadClassification road_classification;
|
||||
|
||||
@@ -70,8 +70,9 @@ struct InternalExtractorEdge
|
||||
false, // roundabout
|
||||
false, // circular
|
||||
true, // can be startpoint
|
||||
false, // local access only
|
||||
false, // split edge
|
||||
TRAVEL_MODE_INACCESSIBLE,
|
||||
false,
|
||||
guidance::TurnLaneType::empty,
|
||||
guidance::RoadClassification()),
|
||||
weight_data(), duration_data()
|
||||
@@ -88,8 +89,9 @@ struct InternalExtractorEdge
|
||||
bool roundabout,
|
||||
bool circular,
|
||||
bool startpoint,
|
||||
TravelMode travel_mode,
|
||||
bool restricted,
|
||||
bool is_split,
|
||||
TravelMode travel_mode,
|
||||
LaneDescriptionID lane_description,
|
||||
guidance::RoadClassification road_classification,
|
||||
util::Coordinate source_coordinate)
|
||||
@@ -103,8 +105,9 @@ struct InternalExtractorEdge
|
||||
roundabout,
|
||||
circular,
|
||||
startpoint,
|
||||
travel_mode,
|
||||
restricted,
|
||||
is_split,
|
||||
travel_mode,
|
||||
lane_description,
|
||||
std::move(road_classification)),
|
||||
weight_data(std::move(weight_data)), duration_data(std::move(duration_data)),
|
||||
@@ -134,8 +137,9 @@ struct InternalExtractorEdge
|
||||
false, // roundabout
|
||||
false, // circular
|
||||
true, // can be startpoint
|
||||
false, // local access only
|
||||
false, // split edge
|
||||
TRAVEL_MODE_INACCESSIBLE,
|
||||
false,
|
||||
INVALID_LANE_DESCRIPTIONID,
|
||||
guidance::RoadClassification(),
|
||||
util::Coordinate());
|
||||
@@ -152,8 +156,9 @@ struct InternalExtractorEdge
|
||||
false, // roundabout
|
||||
false, // circular
|
||||
true, // can be startpoint
|
||||
false, // local access only
|
||||
false, // split edge
|
||||
TRAVEL_MODE_INACCESSIBLE,
|
||||
false,
|
||||
INVALID_LANE_DESCRIPTIONID,
|
||||
guidance::RoadClassification(),
|
||||
util::Coordinate());
|
||||
|
||||
@@ -25,27 +25,29 @@ struct NodeBasedEdge
|
||||
bool roundabout,
|
||||
bool circular,
|
||||
bool startpoint,
|
||||
TravelMode travel_mode,
|
||||
bool restricted,
|
||||
bool is_split,
|
||||
TravelMode travel_mode,
|
||||
const LaneDescriptionID lane_description_id,
|
||||
guidance::RoadClassification road_classification);
|
||||
|
||||
bool operator<(const NodeBasedEdge &other) const;
|
||||
|
||||
NodeID source;
|
||||
NodeID target;
|
||||
NodeID name_id;
|
||||
EdgeWeight weight;
|
||||
EdgeWeight duration;
|
||||
std::uint8_t forward : 1;
|
||||
std::uint8_t backward : 1;
|
||||
std::uint8_t roundabout : 1;
|
||||
std::uint8_t circular : 1;
|
||||
std::uint8_t startpoint : 1;
|
||||
std::uint8_t is_split : 1;
|
||||
TravelMode travel_mode : 4;
|
||||
LaneDescriptionID lane_description_id;
|
||||
guidance::RoadClassification road_classification;
|
||||
NodeID source; // 32 4
|
||||
NodeID target; // 32 4
|
||||
NodeID name_id; // 32 4
|
||||
EdgeWeight weight; // 32 4
|
||||
EdgeWeight duration; // 32 4
|
||||
std::uint8_t forward : 1; // 1
|
||||
std::uint8_t backward : 1; // 1
|
||||
std::uint8_t roundabout : 1; // 1
|
||||
std::uint8_t circular : 1; // 1
|
||||
std::uint8_t startpoint : 1; // 1
|
||||
std::uint8_t restricted : 1; // 1
|
||||
std::uint8_t is_split : 1; // 1
|
||||
TravelMode travel_mode : 4; // 4
|
||||
LaneDescriptionID lane_description_id; // 16 2
|
||||
guidance::RoadClassification road_classification; // 16 2
|
||||
};
|
||||
|
||||
struct NodeBasedEdgeWithOSM : NodeBasedEdge
|
||||
@@ -60,8 +62,9 @@ struct NodeBasedEdgeWithOSM : NodeBasedEdge
|
||||
bool roundabout,
|
||||
bool circular,
|
||||
bool startpoint,
|
||||
TravelMode travel_mode,
|
||||
bool restricted,
|
||||
bool is_split,
|
||||
TravelMode travel_mode,
|
||||
const LaneDescriptionID lane_description_id,
|
||||
guidance::RoadClassification road_classification);
|
||||
|
||||
@@ -74,7 +77,7 @@ 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),
|
||||
is_split(false), travel_mode(TRAVEL_MODE_INACCESSIBLE),
|
||||
restricted(false), is_split(false), travel_mode(TRAVEL_MODE_INACCESSIBLE),
|
||||
lane_description_id(INVALID_LANE_DESCRIPTIONID)
|
||||
{
|
||||
}
|
||||
@@ -89,13 +92,14 @@ inline NodeBasedEdge::NodeBasedEdge(NodeID source,
|
||||
bool roundabout,
|
||||
bool circular,
|
||||
bool startpoint,
|
||||
TravelMode travel_mode,
|
||||
bool restricted,
|
||||
bool is_split,
|
||||
TravelMode travel_mode,
|
||||
const LaneDescriptionID lane_description_id,
|
||||
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), is_split(is_split), travel_mode(travel_mode),
|
||||
startpoint(startpoint), restricted(restricted), is_split(is_split), travel_mode(travel_mode),
|
||||
lane_description_id(lane_description_id), road_classification(std::move(road_classification))
|
||||
{
|
||||
}
|
||||
@@ -127,8 +131,9 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
|
||||
bool roundabout,
|
||||
bool circular,
|
||||
bool startpoint,
|
||||
TravelMode travel_mode,
|
||||
bool restricted,
|
||||
bool is_split,
|
||||
TravelMode travel_mode,
|
||||
const LaneDescriptionID lane_description_id,
|
||||
guidance::RoadClassification road_classification)
|
||||
: NodeBasedEdge(SPECIAL_NODEID,
|
||||
@@ -141,8 +146,9 @@ inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
|
||||
roundabout,
|
||||
circular,
|
||||
startpoint,
|
||||
travel_mode,
|
||||
restricted,
|
||||
is_split,
|
||||
travel_mode,
|
||||
lane_description_id,
|
||||
std::move(road_classification)),
|
||||
osm_source_id(std::move(source)), osm_target_id(std::move(target))
|
||||
|
||||
Reference in New Issue
Block a user