actually calculate distance instead of using .distance which is a timing value

This commit is contained in:
Moritz Kobitzsch
2016-10-20 12:15:36 +02:00
parent 5e167b8745
commit ecee13bffa
11 changed files with 111 additions and 6 deletions
+6 -2
View File
@@ -162,8 +162,12 @@ operator()(const NodeID, const EdgeID source_edge_id, Intersection intersection)
return intersection;
// Threshold check, if the intersection is too far away, don't bother continuing
const auto &next_road_data = node_based_graph.GetEdgeData(next_road.turn.eid);
if (next_road_data.distance > MAX_SLIPROAD_THRESHOLD)
const auto coordinate_extractor = intersection_generator.GetCoordinateExtractor();
const auto next_road_length = util::coordinate_calculation::getLength(
coordinate_extractor.GetForwardCoordinatesAlongRoad(
node_based_graph.GetTarget(source_edge_id), next_road.turn.eid),
&util::coordinate_calculation::haversineDistance);
if (next_road_length > MAX_SLIPROAD_THRESHOLD)
{
return intersection;
}