[traffic] Ignore access flags when decoding closure events

Fixes decoding of closures which are mapped in OSM as access restrictions

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-11-13 21:16:45 +02:00
parent 9d4801886e
commit d4c002851b
4 changed files with 45 additions and 6 deletions

View File

@@ -88,6 +88,11 @@ protected:
*/
std::map<std::string, traffxml::TraffMessage> & m_messageCache;
/**
* @brief Consolidated traffic impact of the message currently being decoded
*/
std::optional<traffxml::TrafficImpact> m_trafficImpact;
private:
};
@@ -321,6 +326,18 @@ public:
routing::RoadGeometry const & to_road, bool is_left_hand_traffic = false) const override;
double GetFerryLandingPenalty(Purpose /* purpose */) const override;
/**
* @brief Whether access restrictions are ignored.
*
* A return value of false indicates that access restrictions should be observed, which is the
* default behavior for a routing use case. If true, it indicates that routing should ignore
* access restrictions. This is needed to resolve traffic message locations; it could also be
* used e.g. for emergency vehicle use cases.
*
* This implementation may return true or false, depending on the location being decoded.
*/
bool IsAccessIgnored() override;
private:
RoutingTraffDecoder & m_decoder;
};