diff --git a/include/engine/api/route_api.hpp b/include/engine/api/route_api.hpp index 8d8e2a18c..e3b9ff8d5 100644 --- a/include/engine/api/route_api.hpp +++ b/include/engine/api/route_api.hpp @@ -93,7 +93,7 @@ class RouteAPI : public BaseAPI auto leg_geometry = guidance::assembleGeometry( BaseAPI::facade, path_data, phantoms.source_phantom, phantoms.target_phantom); auto leg = guidance::assembleLeg(BaseAPI::facade, path_data, leg_geometry, - phantoms.target_phantom, reversed_target); + phantoms.source_phantom, phantoms.target_phantom, reversed_target); if (parameters.steps) { diff --git a/include/engine/guidance/assemble_leg.hpp b/include/engine/guidance/assemble_leg.hpp index 2470f873b..bf34d74d1 100644 --- a/include/engine/guidance/assemble_leg.hpp +++ b/include/engine/guidance/assemble_leg.hpp @@ -99,12 +99,12 @@ template RouteLeg assembleLeg(const DataFacadeT &facade, const std::vector &route_data, const LegGeometry &leg_geometry, + const PhantomNode &source_node, const PhantomNode &target_node, const bool target_traversed_in_reverse) { const auto target_duration = - (target_traversed_in_reverse ? target_node.reverse_weight - : target_node.forward_weight) / + (target_traversed_in_reverse ? target_node.reverse_weight : target_node.forward_weight) / 10.; auto distance = std::accumulate(leg_geometry.segment_distances.begin(), @@ -135,7 +135,14 @@ RouteLeg assembleLeg(const DataFacadeT &facade, // `forward_offset`: duration of (c, d) // path_data will have entries for (s,b), (b, c), (c, d) but (d, t) is only // caputed by the phantom node. So we need to add the target duration here. + // On local segments, the target duration is already part of the duration, however. + duration = duration + target_duration; + if (route_data.empty()) + { + duration -= + (target_traversed_in_reverse ? source_node.reverse_weight : source_node.forward_weight) / 10; + } auto summary_array = detail::summarizeRoute(route_data); BOOST_ASSERT(detail::MAX_USED_SEGMENTS > 0); diff --git a/src/extractor/edge_based_graph_factory.cpp b/src/extractor/edge_based_graph_factory.cpp index 4cbde57c7..53d78c5c5 100644 --- a/src/extractor/edge_based_graph_factory.cpp +++ b/src/extractor/edge_based_graph_factory.cpp @@ -352,6 +352,7 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( // the following is the core of the loop. unsigned distance = edge_data1.distance; + std::cout << "Distance: " << distance << std::endl; if (m_traffic_lights.find(node_v) != m_traffic_lights.end()) { distance += profile_properties.traffic_signal_penalty;