bugfixing/classification

This commit is contained in:
Moritz Kobitzsch
2016-03-03 15:36:03 +01:00
committed by Patrick Niklaus
parent b08b360f38
commit 58628a4bfc
17 changed files with 214 additions and 121 deletions
+10 -6
View File
@@ -28,8 +28,14 @@ namespace json
namespace detail
{
const constexpr char *modifier_names[] = {"uturn", "sharp right", "right", "slight right",
"straight", "slight left", "left", "sharp left"};
const constexpr char *modifier_names[] = {"uturn",
"sharp right",
"right",
"slight right",
"straight",
"slight left",
"left",
"sharp left"};
// translations of TurnTypes. Not all types are exposed to the outside world.
// invalid types should never be returned as part of the API
@@ -40,12 +46,10 @@ const constexpr char *turn_type_names[] = {
"invalid", "invalid", "restriction", "notification"};
// Check whether to include a modifier in the result of the API
inline bool isValidModifier(const TurnType type,
const DirectionModifier modifier)
inline bool isValidModifier(const TurnType type, const DirectionModifier modifier)
{
if (type == TurnType::Location && modifier != DirectionModifier::Left &&
modifier != DirectionModifier::Straight &&
modifier != DirectionModifier::Right)
modifier != DirectionModifier::Straight && modifier != DirectionModifier::Right)
return false;
return true;
}
+1 -2
View File
@@ -51,8 +51,7 @@ PathData mergeInto(PathData destination, const PathData &source)
BOOST_ASSERT(canMergeTrivially(destination, source));
return detail::forwardInto(destination, source);
}
if (source.turn_instruction == TurnType::Suppressed &&
detail::canMergeTrivially(destination, source))
if (source.turn_instruction.type == TurnType::Suppressed)
{
return detail::forwardInto(destination, source);
}
+2 -2
View File
@@ -59,8 +59,8 @@ Status ViaRoutePlugin::HandleRequest(const api::RouteParameters &route_parameter
auto snapped_phantoms = SnapPhantomNodes(phantom_node_pairs);
InternalRouteResult raw_route;
auto build_phantom_pairs = [&raw_route](const PhantomNode &first_node,
const PhantomNode &second_node)
auto build_phantom_pairs =
[&raw_route](const PhantomNode &first_node, const PhantomNode &second_node)
{
raw_route.segment_end_coordinates.push_back(PhantomNodes{first_node, second_node});
};