Split intersection analysis and guidance code
Intersection analysis occupy in osrm::extractor::intersection namespace and guidance code osrm::guidance
This commit is contained in:
@@ -12,6 +12,7 @@ namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
using namespace osrm::guidance;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
@@ -10,16 +10,14 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
using osrm::extractor::guidance::TurnInstruction;
|
||||
using osrm::util::angularDeviation;
|
||||
using namespace osrm::extractor::guidance;
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
using osrm::util::angularDeviation;
|
||||
using namespace osrm::guidance;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -53,7 +51,7 @@ double findTotalTurnAngle(const RouteStep &entry_step, const RouteStep &exit_ste
|
||||
// both angles are in the same direction, the total turn gets increased
|
||||
//
|
||||
// a ---- b
|
||||
// \
|
||||
// \
|
||||
// c
|
||||
// |
|
||||
// d
|
||||
@@ -286,8 +284,7 @@ void StaggeredTurnStrategy::operator()(RouteStep &step_at_turn_location,
|
||||
: TurnType::NewName;
|
||||
}
|
||||
|
||||
SetFixedInstructionStrategy::SetFixedInstructionStrategy(
|
||||
const extractor::guidance::TurnInstruction instruction)
|
||||
SetFixedInstructionStrategy::SetFixedInstructionStrategy(const TurnInstruction instruction)
|
||||
: instruction(instruction)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -9,16 +9,13 @@
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
|
||||
using osrm::extractor::guidance::TurnInstruction;
|
||||
using osrm::extractor::guidance::isLeftTurn;
|
||||
using osrm::extractor::guidance::isRightTurn;
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
using namespace osrm::guidance;
|
||||
|
||||
std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
|
||||
const double min_distance_needed_for_lane_change)
|
||||
|
||||
@@ -23,20 +23,15 @@
|
||||
#include <limits>
|
||||
#include <utility>
|
||||
|
||||
using osrm::util::angularDeviation;
|
||||
using osrm::extractor::guidance::getTurnDirection;
|
||||
using osrm::extractor::guidance::hasRampType;
|
||||
using osrm::extractor::guidance::mirrorDirectionModifier;
|
||||
using osrm::extractor::guidance::bearingToDirectionModifier;
|
||||
|
||||
using RouteStepIterator = std::vector<osrm::engine::guidance::RouteStep>::iterator;
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
using namespace osrm::guidance;
|
||||
|
||||
using RouteStepIterator = std::vector<osrm::engine::guidance::RouteStep>::iterator;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -465,7 +460,7 @@ std::vector<RouteStep> assignRelativeLocations(std::vector<RouteStep> steps,
|
||||
distance_to_start <= MAXIMAL_RELATIVE_DISTANCE
|
||||
? bearingToDirectionModifier(util::coordinate_calculation::computeAngle(
|
||||
source_node.input_location, leg_geometry.locations[0], leg_geometry.locations[1]))
|
||||
: extractor::guidance::DirectionModifier::UTurn;
|
||||
: DirectionModifier::UTurn;
|
||||
|
||||
steps.front().maneuver.instruction.direction_modifier = initial_modifier;
|
||||
|
||||
@@ -478,7 +473,7 @@ std::vector<RouteStep> assignRelativeLocations(std::vector<RouteStep> steps,
|
||||
leg_geometry.locations[leg_geometry.locations.size() - 2],
|
||||
leg_geometry.locations[leg_geometry.locations.size() - 1],
|
||||
target_node.input_location))
|
||||
: extractor::guidance::DirectionModifier::UTurn;
|
||||
: DirectionModifier::UTurn;
|
||||
|
||||
steps.back().maneuver.instruction.direction_modifier = final_modifier;
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
using namespace osrm::guidance;
|
||||
|
||||
std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps)
|
||||
{
|
||||
// guard against empty routes, even though they shouldn't happen
|
||||
|
||||
Reference in New Issue
Block a user