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,8 +722,8 @@ 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,8 +743,8 @@ 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,
@ -752,8 +756,8 @@ 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

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,10 +56,11 @@ 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, [this, max_distance, input_coordinate](const std::size_t,
const CandidateSegment &segment) { const CandidateSegment &segment) {
@ -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,10 +158,11 @@ 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 &) { [max_results](const std::size_t num_results, const CandidateSegment &) {
return num_results >= max_results; return num_results >= max_results;
@ -172,13 +179,14 @@ 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]( [this, max_distance, max_results, input_coordinate](const std::size_t num_results,
const std::size_t num_results, const CandidateSegment &segment) { const CandidateSegment &segment) {
return num_results >= max_results || return num_results >= max_results ||
CheckSegmentDistance(input_coordinate, segment, max_distance); CheckSegmentDistance(input_coordinate, segment, max_distance);
}); });
@ -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)
{ {
@ -582,8 +605,8 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
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"

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,14 +152,16 @@ 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 util::Coordinate /*input_coordinate*/,
const engine::Approach /*approach*/) const override 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 util::Coordinate /*input_coordinate*/,
const double /*max_distance*/, const double /*max_distance*/,
const engine::Approach /*approach*/) const override const engine::Approach /*approach*/) const override
{ {
@ -167,7 +169,8 @@ 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 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*/,
@ -177,7 +180,8 @@ 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 util::Coordinate /*input_coordinate*/,
const int /*bearing*/, const int /*bearing*/,
const int /*bearing_range*/, const int /*bearing_range*/,
const engine::Approach /*approach*/) const override const engine::Approach /*approach*/) const override

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

@ -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);