Use formating script.

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
This commit is contained in:
FILLAU Jean-Maxime 2017-05-29 14:46:11 +02:00 committed by Patrick Niklaus
parent 82a149eb87
commit c573cdb0ae
11 changed files with 150 additions and 115 deletions

View File

@ -28,9 +28,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ENGINE_API_BASE_PARAMETERS_HPP #ifndef ENGINE_API_BASE_PARAMETERS_HPP
#define ENGINE_API_BASE_PARAMETERS_HPP #define ENGINE_API_BASE_PARAMETERS_HPP
#include "engine/approach.hpp"
#include "engine/bearing.hpp" #include "engine/bearing.hpp"
#include "engine/hint.hpp" #include "engine/hint.hpp"
#include "engine/approach.hpp"
#include "util/coordinate.hpp" #include "util/coordinate.hpp"
#include <boost/optional.hpp> #include <boost/optional.hpp>

View File

@ -6,8 +6,8 @@
#include "engine/datafacade/datafacade_base.hpp" #include "engine/datafacade/datafacade_base.hpp"
#include "engine/algorithm.hpp" #include "engine/algorithm.hpp"
#include "engine/geospatial_query.hpp"
#include "engine/approach.hpp" #include "engine/approach.hpp"
#include "engine/geospatial_query.hpp"
#include "customizer/edge_based_graph.hpp" #include "customizer/edge_based_graph.hpp"
@ -656,7 +656,8 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
{ {
BOOST_ASSERT(m_geospatial_query.get()); BOOST_ASSERT(m_geospatial_query.get());
return m_geospatial_query->NearestPhantomNodesInRange(input_coordinate, max_distance, approach); return m_geospatial_query->NearestPhantomNodesInRange(
input_coordinate, max_distance, approach);
} }
std::vector<PhantomNodeWithDistance> std::vector<PhantomNodeWithDistance>
@ -690,7 +691,8 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
{ {
BOOST_ASSERT(m_geospatial_query.get()); BOOST_ASSERT(m_geospatial_query.get());
return m_geospatial_query->NearestPhantomNodes(input_coordinate, max_results, max_distance, approach); return m_geospatial_query->NearestPhantomNodes(
input_coordinate, max_results, max_distance, approach);
} }
std::vector<PhantomNodeWithDistance> std::vector<PhantomNodeWithDistance>
@ -720,9 +722,9 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
input_coordinate, max_results, max_distance, bearing, bearing_range, approach); input_coordinate, max_results, max_distance, bearing, bearing_range, approach);
} }
std::pair<PhantomNode, PhantomNode> std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate input_coordinate, const util::Coordinate input_coordinate,
const engine::Approach approach) const override final const engine::Approach approach) const override final
{ {
BOOST_ASSERT(m_geospatial_query.get()); BOOST_ASSERT(m_geospatial_query.get());
@ -731,7 +733,9 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
} }
std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent( std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
const util::Coordinate input_coordinate, const double max_distance, const engine::Approach approach) const override final const util::Coordinate input_coordinate,
const double max_distance,
const engine::Approach approach) const override final
{ {
BOOST_ASSERT(m_geospatial_query.get()); BOOST_ASSERT(m_geospatial_query.get());
@ -739,12 +743,12 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
input_coordinate, max_distance, approach); input_coordinate, max_distance, approach);
} }
std::pair<PhantomNode, PhantomNode> std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate input_coordinate, const util::Coordinate input_coordinate,
const double max_distance, const double max_distance,
const int bearing, const int bearing,
const int bearing_range, const int bearing_range,
const engine::Approach approach) const override final const engine::Approach approach) const override final
{ {
BOOST_ASSERT(m_geospatial_query.get()); BOOST_ASSERT(m_geospatial_query.get());
@ -752,11 +756,11 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
input_coordinate, max_distance, bearing, bearing_range, approach); input_coordinate, max_distance, bearing, bearing_range, approach);
} }
std::pair<PhantomNode, PhantomNode> std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent(
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate input_coordinate, const util::Coordinate input_coordinate,
const int bearing, const int bearing,
const int bearing_range, const int bearing_range,
const engine::Approach approach) const override final const engine::Approach approach) const override final
{ {
BOOST_ASSERT(m_geospatial_query.get()); BOOST_ASSERT(m_geospatial_query.get());
@ -894,7 +898,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
bool IsLeftHandDriving() const override final bool IsLeftHandDriving() const override final
{ {
return m_profile_properties->left_hand_driving; return m_profile_properties->left_hand_driving;
} }
}; };

View File

@ -9,8 +9,8 @@
#include "extractor/guidance/turn_instruction.hpp" #include "extractor/guidance/turn_instruction.hpp"
#include "extractor/guidance/turn_lane_types.hpp" #include "extractor/guidance/turn_lane_types.hpp"
#include "extractor/original_edge_data.hpp" #include "extractor/original_edge_data.hpp"
#include "engine/phantom_node.hpp"
#include "engine/approach.hpp" #include "engine/approach.hpp"
#include "engine/phantom_node.hpp"
#include "util/exception.hpp" #include "util/exception.hpp"
#include "util/guidance/bearing_class.hpp" #include "util/guidance/bearing_class.hpp"
#include "util/guidance/entry_class.hpp" #include "util/guidance/entry_class.hpp"

View File

@ -1,8 +1,8 @@
#ifndef GEOSPATIAL_QUERY_HPP #ifndef GEOSPATIAL_QUERY_HPP
#define GEOSPATIAL_QUERY_HPP #define GEOSPATIAL_QUERY_HPP
#include "engine/phantom_node.hpp"
#include "engine/approach.hpp" #include "engine/approach.hpp"
#include "engine/phantom_node.hpp"
#include "util/bearing.hpp" #include "util/bearing.hpp"
#include "util/coordinate_calculation.hpp" #include "util/coordinate_calculation.hpp"
#include "util/rectangle.hpp" #include "util/rectangle.hpp"
@ -56,15 +56,16 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
const double max_distance, const double max_distance,
const engine::Approach approach) const const engine::Approach approach) const
{ {
auto results = auto results = rtree.Nearest(
rtree.Nearest(input_coordinate, input_coordinate,
[this, approach, &input_coordinate](const CandidateSegment &segment) { [this, approach, &input_coordinate](const CandidateSegment &segment) {
return boolPairAnd(HasValidEdge(segment), approach_usage(input_coordinate, segment, approach)); return boolPairAnd(HasValidEdge(segment),
}, approach_usage(input_coordinate, segment, approach));
[this, max_distance, input_coordinate](const std::size_t, },
const CandidateSegment &segment) { [this, max_distance, input_coordinate](const std::size_t,
return CheckSegmentDistance(input_coordinate, segment, max_distance); const CandidateSegment &segment) {
}); return CheckSegmentDistance(input_coordinate, segment, max_distance);
});
return MakePhantomNodes(input_coordinate, results); return MakePhantomNodes(input_coordinate, results);
} }
@ -80,11 +81,12 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
{ {
auto results = rtree.Nearest( auto results = rtree.Nearest(
input_coordinate, input_coordinate,
[this, approach, &input_coordinate, bearing, bearing_range, max_distance](const CandidateSegment &segment) { [this, approach, &input_coordinate, bearing, bearing_range, max_distance](
auto use_direction = boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range), const CandidateSegment &segment) {
HasValidEdge(segment)); auto use_direction = boolPairAnd(
use_direction = boolPairAnd(use_direction, CheckSegmentBearing(segment, bearing, bearing_range), HasValidEdge(segment));
approach_usage(input_coordinate, segment, approach)); use_direction =
boolPairAnd(use_direction, approach_usage(input_coordinate, segment, approach));
return use_direction; return use_direction;
}, },
[this, max_distance, input_coordinate](const std::size_t, [this, max_distance, input_coordinate](const std::size_t,
@ -106,10 +108,12 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
{ {
auto results = rtree.Nearest( auto results = rtree.Nearest(
input_coordinate, input_coordinate,
[this, approach, &input_coordinate, bearing, bearing_range](const CandidateSegment &segment) { [this, approach, &input_coordinate, bearing, bearing_range](
auto use_direction = boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range), const CandidateSegment &segment) {
HasValidEdge(segment)); auto use_direction = boolPairAnd(
return boolPairAnd(use_direction, approach_usage(input_coordinate, segment, approach)); CheckSegmentBearing(segment, bearing, bearing_range), HasValidEdge(segment));
return boolPairAnd(use_direction,
approach_usage(input_coordinate, segment, approach));
}, },
[max_results](const std::size_t num_results, const CandidateSegment &) { [max_results](const std::size_t num_results, const CandidateSegment &) {
return num_results >= max_results; return num_results >= max_results;
@ -131,10 +135,12 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
{ {
auto results = rtree.Nearest( auto results = rtree.Nearest(
input_coordinate, input_coordinate,
[this, approach, &input_coordinate, bearing, bearing_range](const CandidateSegment &segment) { [this, approach, &input_coordinate, bearing, bearing_range](
auto use_direction = boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range), const CandidateSegment &segment) {
HasValidEdge(segment)); auto use_direction = boolPairAnd(
return boolPairAnd(use_direction, approach_usage(input_coordinate, segment, approach)); CheckSegmentBearing(segment, bearing, bearing_range), HasValidEdge(segment));
return boolPairAnd(use_direction,
approach_usage(input_coordinate, segment, approach));
}, },
[this, max_distance, max_results, input_coordinate](const std::size_t num_results, [this, max_distance, max_results, input_coordinate](const std::size_t num_results,
const CandidateSegment &segment) { const CandidateSegment &segment) {
@ -152,14 +158,15 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
const unsigned max_results, const unsigned max_results,
const engine::Approach approach) const const engine::Approach approach) const
{ {
auto results = auto results = rtree.Nearest(
rtree.Nearest(input_coordinate, input_coordinate,
[this, approach, &input_coordinate](const CandidateSegment &segment) { [this, approach, &input_coordinate](const CandidateSegment &segment) {
return boolPairAnd(HasValidEdge(segment), approach_usage(input_coordinate, segment, approach)); return boolPairAnd(HasValidEdge(segment),
}, approach_usage(input_coordinate, segment, approach));
[max_results](const std::size_t num_results, const CandidateSegment &) { },
return num_results >= max_results; [max_results](const std::size_t num_results, const CandidateSegment &) {
}); return num_results >= max_results;
});
return MakePhantomNodes(input_coordinate, results); return MakePhantomNodes(input_coordinate, results);
} }
@ -172,16 +179,17 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
const double max_distance, const double max_distance,
const engine::Approach approach) const const engine::Approach approach) const
{ {
auto results = auto results = rtree.Nearest(
rtree.Nearest(input_coordinate, input_coordinate,
[this, approach, &input_coordinate](const CandidateSegment &segment) { [this, approach, &input_coordinate](const CandidateSegment &segment) {
return boolPairAnd(HasValidEdge(segment), approach_usage(input_coordinate, segment, approach)); return boolPairAnd(HasValidEdge(segment),
}, approach_usage(input_coordinate, segment, approach));
[this, max_distance, max_results, input_coordinate]( },
const std::size_t num_results, const CandidateSegment &segment) { [this, max_distance, max_results, input_coordinate](const std::size_t num_results,
return num_results >= max_results || const CandidateSegment &segment) {
CheckSegmentDistance(input_coordinate, segment, max_distance); return num_results >= max_results ||
}); CheckSegmentDistance(input_coordinate, segment, max_distance);
});
return MakePhantomNodes(input_coordinate, results); return MakePhantomNodes(input_coordinate, results);
} }
@ -197,13 +205,15 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
bool has_big_component = false; bool has_big_component = false;
auto results = rtree.Nearest( auto results = rtree.Nearest(
input_coordinate, input_coordinate,
[this, approach, &input_coordinate, &has_big_component, &has_small_component](const CandidateSegment &segment) { [this, approach, &input_coordinate, &has_big_component, &has_small_component](
const CandidateSegment &segment) {
auto use_segment = auto use_segment =
(!has_small_component || (!has_big_component && !IsTinyComponent(segment))); (!has_small_component || (!has_big_component && !IsTinyComponent(segment)));
auto use_directions = std::make_pair(use_segment, use_segment); auto use_directions = std::make_pair(use_segment, use_segment);
const auto valid_edges = HasValidEdge(segment); const auto valid_edges = HasValidEdge(segment);
use_directions = boolPairAnd(use_directions, valid_edges); use_directions = boolPairAnd(use_directions, valid_edges);
use_directions = boolPairAnd(use_directions, approach_usage(input_coordinate, segment, approach)); use_directions = boolPairAnd(use_directions,
approach_usage(input_coordinate, segment, approach));
if (use_directions.first || use_directions.second) if (use_directions.first || use_directions.second)
{ {
@ -274,15 +284,23 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
// Returns the nearest phantom node. If this phantom node is not from a big component // Returns the nearest phantom node. If this phantom node is not from a big component
// a second phantom node is return that is the nearest coordinate in a big component. // a second phantom node is return that is the nearest coordinate in a big component.
std::pair<PhantomNode, PhantomNode> NearestPhantomNodeWithAlternativeFromBigComponent( std::pair<PhantomNode, PhantomNode>
const util::Coordinate input_coordinate, const int bearing, const int bearing_range, const engine::Approach approach) const NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate input_coordinate,
const int bearing,
const int bearing_range,
const engine::Approach approach) const
{ {
bool has_small_component = false; bool has_small_component = false;
bool has_big_component = false; bool has_big_component = false;
auto results = rtree.Nearest( auto results = rtree.Nearest(
input_coordinate, input_coordinate,
[this, approach, &input_coordinate, bearing, bearing_range, &has_big_component, &has_small_component]( [this,
const CandidateSegment &segment) { approach,
&input_coordinate,
bearing,
bearing_range,
&has_big_component,
&has_small_component](const CandidateSegment &segment) {
auto use_segment = auto use_segment =
(!has_small_component || (!has_big_component && !IsTinyComponent(segment))); (!has_small_component || (!has_big_component && !IsTinyComponent(segment)));
auto use_directions = std::make_pair(use_segment, use_segment); auto use_directions = std::make_pair(use_segment, use_segment);
@ -293,8 +311,8 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
use_directions = use_directions =
boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range), boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range),
HasValidEdge(segment)); HasValidEdge(segment));
use_directions = boolPairAnd(use_directions, use_directions = boolPairAnd(
approach_usage(input_coordinate, segment, approach)); use_directions, approach_usage(input_coordinate, segment, approach));
if (use_directions.first || use_directions.second) if (use_directions.first || use_directions.second)
{ {
@ -332,8 +350,13 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
bool has_big_component = false; bool has_big_component = false;
auto results = rtree.Nearest( auto results = rtree.Nearest(
input_coordinate, input_coordinate,
[this, approach, &input_coordinate, bearing, bearing_range, &has_big_component, &has_small_component]( [this,
const CandidateSegment &segment) { approach,
&input_coordinate,
bearing,
bearing_range,
&has_big_component,
&has_small_component](const CandidateSegment &segment) {
auto use_segment = auto use_segment =
(!has_small_component || (!has_big_component && !IsTinyComponent(segment))); (!has_small_component || (!has_big_component && !IsTinyComponent(segment)));
auto use_directions = std::make_pair(use_segment, use_segment); auto use_directions = std::make_pair(use_segment, use_segment);
@ -344,8 +367,8 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
use_directions = use_directions =
boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range), boolPairAnd(CheckSegmentBearing(segment, bearing, bearing_range),
HasValidEdge(segment)); HasValidEdge(segment));
use_directions = boolPairAnd(use_directions, use_directions = boolPairAnd(
approach_usage(input_coordinate, segment, approach)); use_directions, approach_usage(input_coordinate, segment, approach));
if (use_directions.first || use_directions.second) if (use_directions.first || use_directions.second)
{ {
@ -579,11 +602,11 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
} }
std::pair<bool, bool> approach_usage(const util::Coordinate &input_coordinate, std::pair<bool, bool> approach_usage(const util::Coordinate &input_coordinate,
const CandidateSegment &segment, const CandidateSegment &segment,
const engine::Approach approach) const const engine::Approach approach) const
{ {
bool isOnewaySegment = !(segment.data.forward_segment_id.enabled && bool isOnewaySegment =
segment.data.reverse_segment_id.enabled); !(segment.data.forward_segment_id.enabled && segment.data.reverse_segment_id.enabled);
if (!isOnewaySegment && approach == CURB) if (!isOnewaySegment && approach == CURB)
{ {
// Check the counter clockwise // Check the counter clockwise
@ -596,7 +619,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
bool input_coordinate_is_at_right = !util::coordinate_calculation::isCCW( bool input_coordinate_is_at_right = !util::coordinate_calculation::isCCW(
coordinates[segment.data.u], coordinates[segment.data.v], input_coordinate); coordinates[segment.data.u], coordinates[segment.data.v], input_coordinate);
if(datafacade.IsLeftHandDriving()) if (datafacade.IsLeftHandDriving())
input_coordinate_is_at_right = !input_coordinate_is_at_right; input_coordinate_is_at_right = !input_coordinate_is_at_right;
return std::make_pair(input_coordinate_is_at_right, (!input_coordinate_is_at_right)); return std::make_pair(input_coordinate_is_at_right, (!input_coordinate_is_at_right));

View File

@ -149,8 +149,8 @@ class BasePlugin
} }
else else
{ {
phantom_nodes[i] = phantom_nodes[i] = facade.NearestPhantomNodesInRange(
facade.NearestPhantomNodesInRange(parameters.coordinates[i], radiuses[i], approach); parameters.coordinates[i], radiuses[i], approach);
} }
} }
@ -212,13 +212,15 @@ class BasePlugin
{ {
if (use_radiuses && parameters.radiuses[i]) if (use_radiuses && parameters.radiuses[i])
{ {
phantom_nodes[i] = facade.NearestPhantomNodes( phantom_nodes[i] = facade.NearestPhantomNodes(parameters.coordinates[i],
parameters.coordinates[i], number_of_results, *parameters.radiuses[i], approach); number_of_results,
*parameters.radiuses[i],
approach);
} }
else else
{ {
phantom_nodes[i] = phantom_nodes[i] = facade.NearestPhantomNodes(
facade.NearestPhantomNodes(parameters.coordinates[i], number_of_results, approach); parameters.coordinates[i], number_of_results, approach);
} }
} }
@ -275,8 +277,7 @@ class BasePlugin
parameters.coordinates[i], parameters.coordinates[i],
parameters.bearings[i]->bearing, parameters.bearings[i]->bearing,
parameters.bearings[i]->range, parameters.bearings[i]->range,
approach approach);
);
} }
} }
else else

View File

@ -3,8 +3,8 @@
#include "nodejs/json_v8_renderer.hpp" #include "nodejs/json_v8_renderer.hpp"
#include "osrm/bearing.hpp"
#include "osrm/approach.hpp" #include "osrm/approach.hpp"
#include "osrm/bearing.hpp"
#include "osrm/coordinate.hpp" #include "osrm/coordinate.hpp"
#include "osrm/engine_config.hpp" #include "osrm/engine_config.hpp"
#include "osrm/json_container.hpp" #include "osrm/json_container.hpp"
@ -332,7 +332,7 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
{ {
const Nan::Utf8String approach_utf8str(approach_raw); const Nan::Utf8String approach_utf8str(approach_raw);
std::string approach_str{*approach_utf8str, std::string approach_str{*approach_utf8str,
*approach_utf8str + approach_utf8str.length()}; *approach_utf8str + approach_utf8str.length()};
if (approach_str == "curb") if (approach_str == "curb")
{ {
params->approaches.push_back(osrm::Approach::CURB); params->approaches.push_back(osrm::Approach::CURB);
@ -344,7 +344,7 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
else else
{ {
Nan::ThrowError("'approach' param must be one of [curb, unrestricted]"); Nan::ThrowError("'approach' param must be one of [curb, unrestricted]");
return false; return false;
} }
} }
else else

View File

@ -149,16 +149,16 @@ struct BaseParametersGrammar : boost::spirit::qi::grammar<Iterator, Signature>
qi::lit("bearings=") > qi::lit("bearings=") >
(-(qi::short_ > ',' > qi::short_))[ph::bind(add_bearing, qi::_r1, qi::_1)] % ';'; (-(qi::short_ > ',' > qi::short_))[ph::bind(add_bearing, qi::_r1, qi::_1)] % ';';
approach_type.add("unrestricted", engine::Approach::UNRESTRICTED)("curb", engine::Approach::CURB); approach_type.add("unrestricted", engine::Approach::UNRESTRICTED)("curb",
approach_rule = engine::Approach::CURB);
qi::lit("approaches=") > approach_rule = qi::lit("approaches=") >
(-approach_type % ';')[ph::bind(&engine::api::BaseParameters::approaches, qi::_r1) = qi::_1]; (-approach_type %
';')[ph::bind(&engine::api::BaseParameters::approaches, qi::_r1) = qi::_1];
base_rule = radiuses_rule(qi::_r1) // base_rule = radiuses_rule(qi::_r1) //
| hints_rule(qi::_r1) // | hints_rule(qi::_r1) //
| bearings_rule(qi::_r1) // | bearings_rule(qi::_r1) //
| generate_hints_rule(qi::_r1) | generate_hints_rule(qi::_r1) | approach_rule(qi::_r1);
| approach_rule(qi::_r1);
} }
protected: protected:

View File

@ -152,35 +152,39 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
} }
std::pair<engine::PhantomNode, engine::PhantomNode> std::pair<engine::PhantomNode, engine::PhantomNode>
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/, NearestPhantomNodeWithAlternativeFromBigComponent(
const engine::Approach /*approach*/) const override const util::Coordinate /*input_coordinate*/,
const engine::Approach /*approach*/) const override
{ {
return {}; return {};
} }
std::pair<engine::PhantomNode, engine::PhantomNode> std::pair<engine::PhantomNode, engine::PhantomNode>
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/, NearestPhantomNodeWithAlternativeFromBigComponent(
const double /*max_distance*/, const util::Coordinate /*input_coordinate*/,
const engine::Approach /*approach*/) const override const double /*max_distance*/,
const engine::Approach /*approach*/) const override
{ {
return {}; return {};
} }
std::pair<engine::PhantomNode, engine::PhantomNode> std::pair<engine::PhantomNode, engine::PhantomNode>
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/, NearestPhantomNodeWithAlternativeFromBigComponent(
const double /*max_distance*/, const util::Coordinate /*input_coordinate*/,
const int /*bearing*/, const double /*max_distance*/,
const int /*bearing_range*/, const int /*bearing*/,
const engine::Approach /*approach*/) const override const int /*bearing_range*/,
const engine::Approach /*approach*/) const override
{ {
return {}; return {};
} }
std::pair<engine::PhantomNode, engine::PhantomNode> std::pair<engine::PhantomNode, engine::PhantomNode>
NearestPhantomNodeWithAlternativeFromBigComponent(const util::Coordinate /*input_coordinate*/, NearestPhantomNodeWithAlternativeFromBigComponent(
const int /*bearing*/, const util::Coordinate /*input_coordinate*/,
const int /*bearing_range*/, const int /*bearing*/,
const engine::Approach /*approach*/) const override const int /*bearing_range*/,
const engine::Approach /*approach*/) const override
{ {
return {}; return {};
} }

View File

@ -2,8 +2,8 @@
#define OSRM_TEST_SERVER_PARAMETERS_IO #define OSRM_TEST_SERVER_PARAMETERS_IO
#include "engine/api/route_parameters.hpp" #include "engine/api/route_parameters.hpp"
#include "engine/bearing.hpp"
#include "engine/approach.hpp" #include "engine/approach.hpp"
#include "engine/bearing.hpp"
#include <ostream> #include <ostream>

View File

@ -400,7 +400,7 @@ BOOST_AUTO_TEST_CASE(valid_route_urls)
BOOST_CHECK_EQUAL(result_17->annotations, true); BOOST_CHECK_EQUAL(result_17->annotations, true);
std::vector<boost::optional<engine::Approach>> approaches_18 = { std::vector<boost::optional<engine::Approach>> approaches_18 = {
boost::none, engine::Approach::CURB, engine::Approach::UNRESTRICTED, engine::Approach::CURB, boost::none, engine::Approach::CURB, engine::Approach::UNRESTRICTED, engine::Approach::CURB,
}; };
RouteParameters reference_18{false, RouteParameters reference_18{false,
false, false,
@ -414,7 +414,8 @@ BOOST_AUTO_TEST_CASE(valid_route_urls)
std::vector<boost::optional<engine::Bearing>>{}, std::vector<boost::optional<engine::Bearing>>{},
approaches_18}; approaches_18};
auto result_18 = parseParameters<RouteParameters>("1,2;3,4;5,6;7,8?steps=false&approaches=;curb;unrestricted;curb"); auto result_18 = parseParameters<RouteParameters>(
"1,2;3,4;5,6;7,8?steps=false&approaches=;curb;unrestricted;curb");
BOOST_CHECK(result_18); BOOST_CHECK(result_18);
BOOST_CHECK_EQUAL(reference_18.steps, result_18->steps); BOOST_CHECK_EQUAL(reference_18.steps, result_18->steps);
BOOST_CHECK_EQUAL(reference_18.alternatives, result_18->alternatives); BOOST_CHECK_EQUAL(reference_18.alternatives, result_18->alternatives);

View File

@ -420,12 +420,14 @@ BOOST_AUTO_TEST_CASE(bearing_tests)
} }
{ {
auto results = query.NearestPhantomNodesInRange(input, 11000, 270, 10, osrm::engine::UNRESTRICTED); auto results =
query.NearestPhantomNodesInRange(input, 11000, 270, 10, osrm::engine::UNRESTRICTED);
BOOST_CHECK_EQUAL(results.size(), 0); BOOST_CHECK_EQUAL(results.size(), 0);
} }
{ {
auto results = query.NearestPhantomNodesInRange(input, 11000, 45, 10, osrm::engine::UNRESTRICTED); auto results =
query.NearestPhantomNodesInRange(input, 11000, 45, 10, osrm::engine::UNRESTRICTED);
BOOST_CHECK_EQUAL(results.size(), 2); BOOST_CHECK_EQUAL(results.size(), 2);
BOOST_CHECK(results[0].phantom_node.forward_segment_id.enabled); BOOST_CHECK(results[0].phantom_node.forward_segment_id.enabled);