2018-01-05 08:33:53 -05:00
|
|
|
#ifndef OSRM_GUIDANCE_TURN_LANE_MATCHER_HPP_
|
|
|
|
#define OSRM_GUIDANCE_TURN_LANE_MATCHER_HPP_
|
2016-05-13 13:18:00 -04:00
|
|
|
|
2018-01-05 07:05:53 -05:00
|
|
|
#include "guidance/intersection.hpp"
|
|
|
|
#include "guidance/turn_instruction.hpp"
|
|
|
|
#include "guidance/turn_lane_data.hpp"
|
2016-05-13 13:18:00 -04:00
|
|
|
|
2016-08-02 09:43:29 -04:00
|
|
|
#include "util/attributes.hpp"
|
2016-05-13 13:18:00 -04:00
|
|
|
#include "util/guidance/turn_lanes.hpp"
|
|
|
|
#include "util/node_based_graph.hpp"
|
|
|
|
|
|
|
|
namespace osrm
|
|
|
|
{
|
|
|
|
namespace guidance
|
|
|
|
{
|
|
|
|
namespace lanes
|
|
|
|
{
|
|
|
|
|
|
|
|
// Translate Turn Lane Tags into a matching modifier
|
2018-01-05 08:33:53 -05:00
|
|
|
DirectionModifier::Enum getMatchingModifier(const extractor::TurnLaneType::Mask tag);
|
2016-05-13 13:18:00 -04:00
|
|
|
|
|
|
|
// check whether a match of a given tag and a turn instruction can be seen as valid
|
2018-01-05 08:33:53 -05:00
|
|
|
bool isValidMatch(const extractor::TurnLaneType::Mask tag, const TurnInstruction instruction);
|
2016-05-13 13:18:00 -04:00
|
|
|
|
2016-06-21 04:41:08 -04:00
|
|
|
// localisation of the best possible match for a tag
|
2018-01-05 08:33:53 -05:00
|
|
|
typename Intersection::const_iterator findBestMatch(const extractor::TurnLaneType::Mask tag,
|
2016-05-13 13:18:00 -04:00
|
|
|
const Intersection &intersection);
|
2016-06-30 03:31:08 -04:00
|
|
|
|
|
|
|
// the quality of a matching to decide between first/second possibility on segregated intersections
|
2018-01-05 08:33:53 -05:00
|
|
|
double getMatchingQuality(const extractor::TurnLaneType::Mask tag, const ConnectedRoad &road);
|
2016-06-30 03:31:08 -04:00
|
|
|
|
2018-01-05 08:33:53 -05:00
|
|
|
typename Intersection::const_iterator
|
|
|
|
findBestMatchForReverse(const extractor::TurnLaneType::Mask leftmost_tag,
|
|
|
|
const Intersection &intersection);
|
2016-05-13 13:18:00 -04:00
|
|
|
|
|
|
|
// a match is trivial if all turns can be associated with their best match in a valid way and the
|
|
|
|
// matches occur in order
|
|
|
|
bool canMatchTrivially(const Intersection &intersection, const LaneDataVector &lane_data);
|
|
|
|
|
|
|
|
// perform a trivial match on the turn lanes
|
2016-08-02 09:43:29 -04:00
|
|
|
OSRM_ATTR_WARN_UNUSED
|
2016-05-13 13:18:00 -04:00
|
|
|
Intersection triviallyMatchLanesToTurns(Intersection intersection,
|
|
|
|
const LaneDataVector &lane_data,
|
2016-06-15 08:38:24 -04:00
|
|
|
const util::NodeBasedDynamicGraph &node_based_graph,
|
2016-06-21 04:41:08 -04:00
|
|
|
const LaneDescriptionID lane_string_id,
|
2016-12-02 04:53:22 -05:00
|
|
|
util::guidance::LaneDataIdMap &lane_data_to_id);
|
2016-05-13 13:18:00 -04:00
|
|
|
|
|
|
|
} // namespace lanes
|
|
|
|
} // namespace guidance
|
|
|
|
} // namespace osrm
|
|
|
|
|
2018-01-05 08:33:53 -05:00
|
|
|
#endif /*OSRM_GUIDANCE_TURN_LANE_MATCHER_HPP_*/
|