Skip to content

Commit

Permalink
Make distance_between_roads symmetrical
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase committed Jan 5, 2018
1 parent 330f25e commit 17eb705
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/extractor/guidance/mergable_road_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,16 @@ bool MergableRoadDetector::HaveSameDirection(const NodeID intersection_node,
return false;

// compare reference distance:
const auto distance_between_roads = util::coordinate_calculation::findClosestDistance(
const auto distance_mid_left_to_right = util::coordinate_calculation::findClosestDistance(
coordinates_to_the_left[coordinates_to_the_left.size() / 2],
coordinates_to_the_right.begin(),
coordinates_to_the_right.end());
const auto distance_mid_right_to_left = util::coordinate_calculation::findClosestDistance(
coordinates_to_the_right[coordinates_to_the_right.size() / 2],
coordinates_to_the_left.begin(),
coordinates_to_the_left.end());
const auto distance_between_roads =
std::min(distance_mid_left_to_right, distance_mid_right_to_left);

const auto lane_count_lhs = std::max<int>(
1, node_based_graph.GetEdgeData(lhs.eid).flags.road_classification.GetNumberOfLanes());
Expand Down

0 comments on commit 17eb705

Please sign in to comment.