fix INVALID_NAME_ID vs INVALID_NAMEID -> EMPTY_NAMEID

This commit is contained in:
Moritz Kobitzsch 2016-05-26 14:46:15 +02:00 committed by Patrick Niklaus
parent 0a53775fb3
commit bdc66049a5
No known key found for this signature in database
GPG Key ID: E426891B5F978B1B
7 changed files with 10 additions and 10 deletions

View File

@ -20,13 +20,12 @@ const double constexpr GROUP_ANGLE = 60;
// angle difference that can be classified as straight, if its the only narrow turn // angle difference that can be classified as straight, if its the only narrow turn
const double constexpr FUZZY_ANGLE_DIFFERENCE = 20.; const double constexpr FUZZY_ANGLE_DIFFERENCE = 20.;
const double constexpr DISTINCTION_RATIO = 2; const double constexpr DISTINCTION_RATIO = 2;
const unsigned constexpr INVALID_NAME_ID = 0;
const double constexpr MAX_ROUNDABOUT_INTERSECTION_RADIUS = 5; const double constexpr MAX_ROUNDABOUT_INTERSECTION_RADIUS = 5;
const double constexpr MAX_ROUNDABOUT_RADIUS = 15; // 30 m diameter as final distinction const double constexpr MAX_ROUNDABOUT_RADIUS = 15; // 30 m diameter as final distinction
const double constexpr INCREASES_BY_FOURTY_PERCENT = 1.4; const double constexpr INCREASES_BY_FOURTY_PERCENT = 1.4;
const unsigned constexpr MAX_SLIPROAD_THRESHOLD = 250; const int constexpr MAX_SLIPROAD_THRESHOLD = 250;
} // namespace guidance } // namespace guidance
} // namespace extractor } // namespace extractor

View File

@ -71,6 +71,7 @@ static const NodeID SPECIAL_NODEID = std::numeric_limits<unsigned>::max();
static const NodeID SPECIAL_SEGMENTID = std::numeric_limits<int>::max(); static const NodeID SPECIAL_SEGMENTID = std::numeric_limits<int>::max();
static const EdgeID SPECIAL_EDGEID = std::numeric_limits<unsigned>::max(); static const EdgeID SPECIAL_EDGEID = std::numeric_limits<unsigned>::max();
static const unsigned INVALID_NAMEID = std::numeric_limits<unsigned>::max(); static const unsigned INVALID_NAMEID = std::numeric_limits<unsigned>::max();
static const unsigned EMPTY_NAMEID = 0;
static const unsigned INVALID_COMPONENTID = 0; static const unsigned INVALID_COMPONENTID = 0;
static const EdgeWeight INVALID_EDGE_WEIGHT = std::numeric_limits<int>::max(); static const EdgeWeight INVALID_EDGE_WEIGHT = std::numeric_limits<int>::max();

View File

@ -616,7 +616,7 @@ std::vector<RouteStep> collapseTurns(std::vector<RouteStep> steps)
// Handle possible u-turns between highways that look like slip-roads // Handle possible u-turns between highways that look like slip-roads
if (steps[two_back_index].name_id == steps[step_index].name_id && if (steps[two_back_index].name_id == steps[step_index].name_id &&
steps[step_index].name_id != INVALID_NAMEID) steps[step_index].name_id != EMPTY_NAMEID)
{ {
steps[one_back_index].maneuver.instruction.type = TurnType::Continue; steps[one_back_index].maneuver.instruction.type = TurnType::Continue;
} }

View File

@ -176,7 +176,7 @@ Intersection IntersectionGenerator::mergeSegregatedRoads(Intersection intersecti
const auto &first_data = node_based_graph.GetEdgeData(intersection[first].turn.eid); const auto &first_data = node_based_graph.GetEdgeData(intersection[first].turn.eid);
const auto &second_data = node_based_graph.GetEdgeData(intersection[second].turn.eid); const auto &second_data = node_based_graph.GetEdgeData(intersection[second].turn.eid);
return first_data.name_id != INVALID_NAME_ID && first_data.name_id == second_data.name_id && return first_data.name_id != EMPTY_NAMEID && first_data.name_id == second_data.name_id &&
!first_data.roundabout && !second_data.roundabout && !first_data.roundabout && !second_data.roundabout &&
first_data.travel_mode == second_data.travel_mode && first_data.travel_mode == second_data.travel_mode &&
first_data.road_classification == second_data.road_classification && first_data.road_classification == second_data.road_classification &&

View File

@ -57,7 +57,7 @@ TurnType::Enum IntersectionHandler::findBasicTurnType(const EdgeID via_edge,
if (!on_ramp && onto_ramp) if (!on_ramp && onto_ramp)
return TurnType::OnRamp; return TurnType::OnRamp;
if (in_data.name_id == out_data.name_id && in_data.name_id != INVALID_NAME_ID) if (in_data.name_id == out_data.name_id && in_data.name_id != EMPTY_NAMEID)
{ {
return TurnType::Continue; return TurnType::Continue;
} }
@ -306,7 +306,7 @@ void IntersectionHandler::assignTrivialTurns(const EdgeID via_eid,
bool IntersectionHandler::isThroughStreet(const std::size_t index, bool IntersectionHandler::isThroughStreet(const std::size_t index,
const Intersection &intersection) const const Intersection &intersection) const
{ {
if (node_based_graph.GetEdgeData(intersection[index].turn.eid).name_id == INVALID_NAME_ID) if (node_based_graph.GetEdgeData(intersection[index].turn.eid).name_id == EMPTY_NAMEID)
return false; return false;
for (const auto &road : intersection) for (const auto &road : intersection)
{ {

View File

@ -129,7 +129,7 @@ Intersection MotorwayHandler::fromMotorway(const EdgeID via_eid, Intersection in
{ {
const auto &out_data = node_based_graph.GetEdgeData(road.turn.eid); const auto &out_data = node_based_graph.GetEdgeData(road.turn.eid);
if (road.turn.angle != 0 && in_data.name_id == out_data.name_id && if (road.turn.angle != 0 && in_data.name_id == out_data.name_id &&
in_data.name_id != INVALID_NAME_ID && in_data.name_id != EMPTY_NAMEID &&
detail::isMotorwayClass(out_data.road_classification.road_class)) detail::isMotorwayClass(out_data.road_classification.road_class))
return road.turn.angle; return road.turn.angle;
} }
@ -379,7 +379,7 @@ Intersection MotorwayHandler::fromRamp(const EdgeID via_eid, Intersection inters
{ {
if (detail::isMotorwayClass(intersection[1].turn.eid, node_based_graph) && if (detail::isMotorwayClass(intersection[1].turn.eid, node_based_graph) &&
node_based_graph.GetEdgeData(intersection[2].turn.eid).name_id != node_based_graph.GetEdgeData(intersection[2].turn.eid).name_id !=
INVALID_NAME_ID && EMPTY_NAMEID &&
node_based_graph.GetEdgeData(intersection[2].turn.eid).name_id == node_based_graph.GetEdgeData(intersection[2].turn.eid).name_id ==
node_based_graph.GetEdgeData(intersection[1].turn.eid).name_id) node_based_graph.GetEdgeData(intersection[1].turn.eid).name_id)
{ {
@ -406,7 +406,7 @@ Intersection MotorwayHandler::fromRamp(const EdgeID via_eid, Intersection inters
BOOST_ASSERT(intersection[2].entry_allowed); BOOST_ASSERT(intersection[2].entry_allowed);
if (detail::isMotorwayClass(intersection[2].turn.eid, node_based_graph) && if (detail::isMotorwayClass(intersection[2].turn.eid, node_based_graph) &&
node_based_graph.GetEdgeData(intersection[1].turn.eid).name_id != node_based_graph.GetEdgeData(intersection[1].turn.eid).name_id !=
INVALID_NAME_ID && EMPTY_NAMEID &&
node_based_graph.GetEdgeData(intersection[1].turn.eid).name_id == node_based_graph.GetEdgeData(intersection[1].turn.eid).name_id ==
node_based_graph.GetEdgeData(intersection[0].turn.eid).name_id) node_based_graph.GetEdgeData(intersection[0].turn.eid).name_id)
{ {

View File

@ -149,7 +149,7 @@ Intersection TurnAnalysis::handleSliproads(const EdgeID source_edge_id,
// Test to see if the source edge and the one we're looking at are the same road // Test to see if the source edge and the one we're looking at are the same road
return road_edge_data.road_classification.road_class == return road_edge_data.road_classification.road_class ==
source_edge_data.road_classification.road_class && source_edge_data.road_classification.road_class &&
road_edge_data.name_id != INVALID_NAME_ID && road_edge_data.name_id != EMPTY_NAMEID &&
road_edge_data.name_id == source_edge_data.name_id && road.entry_allowed && road_edge_data.name_id == source_edge_data.name_id && road.entry_allowed &&
angularDeviation(road.turn.angle, STRAIGHT_ANGLE) < FUZZY_ANGLE_DIFFERENCE; angularDeviation(road.turn.angle, STRAIGHT_ANGLE) < FUZZY_ANGLE_DIFFERENCE;
}); });