Implements Exit Numbers + Names (junction:ref way tag for now)
This commit is contained in:
committed by
Patrick Niklaus
parent
6d78c11fd2
commit
7d900e3b5a
@@ -808,6 +808,11 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
return m_name_table.GetDestinationsForID(id);
|
||||
}
|
||||
|
||||
StringView GetExitsForID(const NameID id) const override final
|
||||
{
|
||||
return m_name_table.GetExitsForID(id);
|
||||
}
|
||||
|
||||
StringView GetDatasourceName(const DatasourceID id) const override final
|
||||
{
|
||||
return m_datasources->GetSourceName(id);
|
||||
|
||||
@@ -158,6 +158,8 @@ class BaseDataFacade
|
||||
|
||||
virtual StringView GetDestinationsForID(const NameID id) const = 0;
|
||||
|
||||
virtual StringView GetExitsForID(const NameID id) const = 0;
|
||||
|
||||
virtual std::string GetTimestamp() const = 0;
|
||||
|
||||
virtual bool GetContinueStraightDefault() const = 0;
|
||||
|
||||
@@ -114,6 +114,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
||||
const auto ref = facade.GetRefForID(step_name_id);
|
||||
const auto pronunciation = facade.GetPronunciationForID(step_name_id);
|
||||
const auto destinations = facade.GetDestinationsForID(step_name_id);
|
||||
const auto exits = facade.GetExitsForID(step_name_id);
|
||||
const auto distance = leg_geometry.segment_distances[segment_index];
|
||||
|
||||
steps.push_back(RouteStep{step_name_id,
|
||||
@@ -121,6 +122,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
||||
ref.to_string(),
|
||||
pronunciation.to_string(),
|
||||
destinations.to_string(),
|
||||
exits.to_string(),
|
||||
NO_ROTARY_NAME,
|
||||
NO_ROTARY_NAME,
|
||||
segment_duration / 10.,
|
||||
@@ -196,6 +198,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
||||
facade.GetRefForID(step_name_id).to_string(),
|
||||
facade.GetPronunciationForID(step_name_id).to_string(),
|
||||
facade.GetDestinationsForID(step_name_id).to_string(),
|
||||
facade.GetExitsForID(step_name_id).to_string(),
|
||||
NO_ROTARY_NAME,
|
||||
NO_ROTARY_NAME,
|
||||
duration / 10.,
|
||||
@@ -237,6 +240,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
||||
facade.GetRefForID(source_name_id).to_string(),
|
||||
facade.GetPronunciationForID(source_name_id).to_string(),
|
||||
facade.GetDestinationsForID(source_name_id).to_string(),
|
||||
facade.GetExitsForID(source_name_id).to_string(),
|
||||
NO_ROTARY_NAME,
|
||||
NO_ROTARY_NAME,
|
||||
duration / 10.,
|
||||
@@ -275,6 +279,7 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
||||
facade.GetRefForID(target_name_id).to_string(),
|
||||
facade.GetPronunciationForID(target_name_id).to_string(),
|
||||
facade.GetDestinationsForID(target_name_id).to_string(),
|
||||
facade.GetExitsForID(target_name_id).to_string(),
|
||||
NO_ROTARY_NAME,
|
||||
NO_ROTARY_NAME,
|
||||
ZERO_DURATION,
|
||||
|
||||
@@ -130,8 +130,14 @@ inline bool haveSameName(const RouteStep &lhs, const RouteStep &rhs)
|
||||
|
||||
// ok, bite the sour grape and check the strings already
|
||||
else
|
||||
return !util::guidance::requiresNameAnnounced(
|
||||
lhs.name, lhs.ref, lhs.pronunciation, rhs.name, rhs.ref, rhs.pronunciation);
|
||||
return !util::guidance::requiresNameAnnounced(lhs.name,
|
||||
lhs.ref,
|
||||
lhs.pronunciation,
|
||||
lhs.exits,
|
||||
rhs.name,
|
||||
rhs.ref,
|
||||
rhs.pronunciation,
|
||||
rhs.exits);
|
||||
}
|
||||
|
||||
// alias for readability, both turn right | left
|
||||
|
||||
@@ -62,6 +62,7 @@ struct RouteStep
|
||||
std::string ref;
|
||||
std::string pronunciation;
|
||||
std::string destinations;
|
||||
std::string exits;
|
||||
std::string rotary_name;
|
||||
std::string rotary_pronunciation;
|
||||
double duration; // duration in seconds
|
||||
@@ -114,6 +115,7 @@ inline void RouteStep::Invalidate()
|
||||
ref.clear();
|
||||
pronunciation.clear();
|
||||
destinations.clear();
|
||||
exits.clear();
|
||||
rotary_name.clear();
|
||||
rotary_pronunciation.clear();
|
||||
duration = 0;
|
||||
@@ -178,6 +180,7 @@ inline RouteStep &RouteStep::AdaptStepSignage(const RouteStep &origin)
|
||||
name = origin.name;
|
||||
pronunciation = origin.pronunciation;
|
||||
destinations = origin.destinations;
|
||||
exits = origin.exits;
|
||||
ref = origin.ref;
|
||||
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user