Adding support for left left hand driving.

Signed-off-by: FILLAU Jean-Maxime <jean-maxime.fillau@mapotempo.com>
This commit is contained in:
FILLAU Jean-Maxime 2017-05-22 16:09:53 +02:00 committed by Patrick Niklaus
parent 17a73e3979
commit 089c98a107
5 changed files with 10 additions and 6 deletions

View File

@ -883,6 +883,11 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
m_lane_description_masks.begin() +
m_lane_description_offsets[lane_description_id + 1]);
}
bool IsLeftHandDriving() const override final
{
return m_profile_properties->left_hand_driving;
}
};
template <typename AlgorithmT> class ContiguousInternalMemoryDataFacade;

View File

@ -172,6 +172,8 @@ class BaseDataFacade
virtual EntryClassID GetEntryClassID(const EdgeID eid) const = 0;
virtual util::guidance::EntryClass GetEntryClass(const EntryClassID entry_class_id) const = 0;
virtual bool IsLeftHandDriving() const = 0;
};
}
}

View File

@ -237,10 +237,8 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
bool input_coordinate_is_at_right = !util::coordinate_calculation::isCCW(
coordinates[segment.data.u], coordinates[segment.data.v], input_coordinate);
// TODO Check the country approach, for the moment right is the default country
// approach.
// if drive left
// input_coordinate_is_at_right = !input_coordinate_is_at_right
if(datafacade.IsLeftHandDriving())
input_coordinate_is_at_right = !input_coordinate_is_at_right;
// Apply the approach.
use_directions.first = use_directions.first && input_coordinate_is_at_right;

View File

@ -232,8 +232,6 @@ class BasePlugin
for (const auto i : util::irange<std::size_t>(0UL, parameters.coordinates.size()))
{
Approach approach = engine::Approach::UNRESTRICTED;
// TODO init at SIDE for test
// SideValue side = engine::SideValue::DEFAULT;
if (use_approaches && parameters.approaches[i])
approach = parameters.approaches[i].get();

View File

@ -197,6 +197,7 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
double GetWeightMultiplier() const override final { return 10.; }
BearingClassID GetBearingClassID(const NodeID /*id*/) const override { return 0; }
EntryClassID GetEntryClassID(const EdgeID /*id*/) const override { return 0; }
bool IsLeftHandDriving() const override { return false; }
util::guidance::TurnBearing PreTurnBearing(const EdgeID /*eid*/) const override final
{