access way names through RouteStep in post processing
This commit is contained in:
parent
d5232d5f5c
commit
56459d37d1
@ -36,10 +36,7 @@ bool isStaggeredIntersection(const RouteStepIterator step_prior_to_intersection,
|
||||
// a - > x
|
||||
bool isUTurn(const RouteStepIterator step_prior_to_intersection,
|
||||
const RouteStepIterator step_entering_intersection,
|
||||
const RouteStepIterator step_leaving_intersection,
|
||||
const std::string &step_prior_name,
|
||||
const std::string &step_entering_name,
|
||||
const std::string &step_leaving_name);
|
||||
const RouteStepIterator step_leaving_intersection);
|
||||
|
||||
// detect oscillating names where a name switch A->B->A occurs. This is often the case due to
|
||||
// bridges or tunnels. Any such oszillation is not supposed to show up
|
||||
|
@ -43,12 +43,11 @@ bool noIntermediaryIntersections(const RouteStep &step)
|
||||
// Link roads, as far as we are concerned, are short unnamed segments between to named segments.
|
||||
bool isLinkRoad(const RouteStep &link_step,
|
||||
const std::string &pre_link_step_name,
|
||||
const std::string &link_step_name,
|
||||
const std::string &post_link_step_name)
|
||||
{
|
||||
const constexpr double MAX_LINK_ROAD_LENGTH = 2 * MAX_COLLAPSE_DISTANCE;
|
||||
const auto is_short = link_step.distance <= MAX_LINK_ROAD_LENGTH;
|
||||
const auto unnamed = link_step_name.empty();
|
||||
const auto unnamed = link_step.name.empty();
|
||||
const auto between_named = !pre_link_step_name.empty() && !post_link_step_name.empty();
|
||||
|
||||
return is_short && unnamed && between_named && noIntermediaryIntersections(link_step);
|
||||
@ -163,10 +162,10 @@ bool isStaggeredIntersection(const RouteStepIterator step_prior_to_intersection,
|
||||
|
||||
bool isUTurn(const RouteStepIterator step_prior_to_intersection,
|
||||
const RouteStepIterator step_entering_intersection,
|
||||
const RouteStepIterator step_leaving_intersection,
|
||||
const std::string &step_prior_name,
|
||||
const std::string &step_entering_name,
|
||||
const std::string &step_leaving_name)
|
||||
const RouteStepIterator step_leaving_intersection)
|
||||
// const std::string &step_prior_name,
|
||||
// const std::string &step_entering_name,
|
||||
// const std::string &step_leaving_name)
|
||||
{
|
||||
if (!basicCollapsePreconditions(
|
||||
step_prior_to_intersection, step_entering_intersection, step_leaving_intersection))
|
||||
@ -200,9 +199,8 @@ bool isUTurn(const RouteStepIterator step_prior_to_intersection,
|
||||
noIntermediaryIntersections(*step_entering_intersection);
|
||||
|
||||
return collapsable || isLinkRoad(*step_entering_intersection,
|
||||
step_prior_name,
|
||||
step_entering_name,
|
||||
step_leaving_name) ||
|
||||
step_prior_to_intersection->name,
|
||||
step_leaving_intersection->name) ||
|
||||
only_allowed_turn;
|
||||
}
|
||||
|
||||
|
@ -371,9 +371,6 @@ RouteSteps collapseTurnInstructions(RouteSteps steps, const datafacade::BaseData
|
||||
break;
|
||||
|
||||
const auto previous_step = findPreviousTurn(current_step);
|
||||
const auto previous_step_name = facade.GetNameForID(previous_step->name_id).to_string();
|
||||
const auto current_step_name = facade.GetNameForID(current_step->name_id).to_string();
|
||||
const auto next_step_name = facade.GetNameForID(next_step->name_id).to_string();
|
||||
|
||||
// don't collapse anything that does change modes
|
||||
if (current_step->mode != next_step->mode)
|
||||
@ -390,12 +387,7 @@ RouteSteps collapseTurnInstructions(RouteSteps steps, const datafacade::BaseData
|
||||
TransferSignageStrategy(),
|
||||
NoModificationStrategy());
|
||||
}
|
||||
else if (isUTurn(previous_step,
|
||||
current_step,
|
||||
next_step,
|
||||
previous_step_name,
|
||||
current_step_name,
|
||||
next_step_name))
|
||||
else if (isUTurn(previous_step, current_step, next_step))
|
||||
{
|
||||
combineRouteSteps(
|
||||
*current_step,
|
||||
@ -475,12 +467,7 @@ RouteSteps collapseTurnInstructions(RouteSteps steps, const datafacade::BaseData
|
||||
const auto far_back_step_name = facade.GetNameForID(far_back_step->name_id).to_string();
|
||||
// due to name changes, we can find u-turns a bit late. Thats why we check far back as
|
||||
// well
|
||||
if (isUTurn(far_back_step,
|
||||
previous_step,
|
||||
current_step,
|
||||
far_back_step_name,
|
||||
previous_step_name,
|
||||
current_step_name))
|
||||
if (isUTurn(far_back_step, previous_step, current_step))
|
||||
{
|
||||
combineRouteSteps(
|
||||
*previous_step,
|
||||
|
Loading…
Reference in New Issue
Block a user