2018-01-05 08:33:53 -05:00
|
|
|
#ifndef OSRM_GUIDANCE_TURN_ANALYSIS
|
|
|
|
#define OSRM_GUIDANCE_TURN_ANALYSIS
|
2016-02-25 08:40:26 -05:00
|
|
|
|
2016-03-23 08:04:23 -04:00
|
|
|
#include "extractor/compressed_edge_container.hpp"
|
2018-01-05 08:33:53 -05:00
|
|
|
#include "extractor/intersection/intersection_view.hpp"
|
2018-03-22 14:26:40 -04:00
|
|
|
#include "extractor/name_table.hpp"
|
2017-08-01 11:18:12 -04:00
|
|
|
#include "extractor/restriction_index.hpp"
|
2016-04-22 05:31:46 -04:00
|
|
|
#include "extractor/suffix_table.hpp"
|
2018-03-21 07:10:02 -04:00
|
|
|
|
2018-01-05 07:05:53 -05:00
|
|
|
#include "guidance/driveway_handler.hpp"
|
|
|
|
#include "guidance/intersection.hpp"
|
|
|
|
#include "guidance/motorway_handler.hpp"
|
|
|
|
#include "guidance/roundabout_handler.hpp"
|
|
|
|
#include "guidance/sliproad_handler.hpp"
|
|
|
|
#include "guidance/statistics_handler.hpp"
|
|
|
|
#include "guidance/suppress_mode_handler.hpp"
|
|
|
|
#include "guidance/turn_classification.hpp"
|
|
|
|
#include "guidance/turn_handler.hpp"
|
2016-02-25 08:40:26 -05:00
|
|
|
|
2016-11-09 10:52:22 -05:00
|
|
|
#include "util/attributes.hpp"
|
2016-04-08 06:49:14 -04:00
|
|
|
#include "util/node_based_graph.hpp"
|
2016-03-16 10:47:33 -04:00
|
|
|
|
2016-03-03 12:30:41 -05:00
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
#include <memory>
|
2016-03-23 08:04:23 -04:00
|
|
|
#include <string>
|
2016-11-18 03:38:26 -05:00
|
|
|
#include <tuple>
|
2016-02-25 08:40:26 -05:00
|
|
|
#include <unordered_set>
|
2016-03-23 08:04:23 -04:00
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
2016-02-25 08:40:26 -05:00
|
|
|
|
|
|
|
namespace osrm
|
|
|
|
{
|
2016-03-01 16:30:31 -05:00
|
|
|
namespace guidance
|
|
|
|
{
|
2016-02-25 08:40:26 -05:00
|
|
|
|
2016-03-08 06:40:45 -05:00
|
|
|
class TurnAnalysis
|
2016-02-25 12:31:29 -05:00
|
|
|
{
|
2016-03-08 06:40:45 -05:00
|
|
|
public:
|
|
|
|
TurnAnalysis(const util::NodeBasedDynamicGraph &node_based_graph,
|
2018-01-05 08:33:53 -05:00
|
|
|
const extractor::EdgeBasedNodeDataContainer &node_data_container,
|
2017-12-03 15:32:17 -05:00
|
|
|
const std::vector<util::Coordinate> &node_coordinates,
|
2018-01-05 08:33:53 -05:00
|
|
|
const extractor::CompressedEdgeContainer &compressed_edge_container,
|
|
|
|
const extractor::RestrictionMap &restriction_map,
|
2016-03-08 06:40:45 -05:00
|
|
|
const std::unordered_set<NodeID> &barrier_nodes,
|
2018-01-05 08:33:53 -05:00
|
|
|
const extractor::TurnLanesIndexedArray &turn_lanes_data,
|
2018-03-21 07:10:02 -04:00
|
|
|
const extractor::NameTable &name_table,
|
2018-01-05 08:33:53 -05:00
|
|
|
const extractor::SuffixTable &street_name_suffix_table);
|
2016-03-08 06:40:45 -05:00
|
|
|
|
2016-11-18 03:38:26 -05:00
|
|
|
/* Full Analysis Process for a single node/edge combination. Use with caution, as the process is
|
|
|
|
* relatively expensive */
|
|
|
|
OSRM_ATTR_WARN_UNUSED
|
|
|
|
Intersection operator()(const NodeID node_prior_to_intersection,
|
|
|
|
const EdgeID entering_via_edge) const;
|
|
|
|
|
|
|
|
// Select turn types based on the intersection shape
|
2016-11-09 10:52:22 -05:00
|
|
|
OSRM_ATTR_WARN_UNUSED
|
2018-01-05 08:33:53 -05:00
|
|
|
Intersection
|
|
|
|
AssignTurnTypes(const NodeID from_node,
|
|
|
|
const EdgeID via_eid,
|
|
|
|
const extractor::intersection::IntersectionView &intersection) const;
|
2016-11-15 05:21:26 -05:00
|
|
|
|
2016-03-08 06:40:45 -05:00
|
|
|
private:
|
|
|
|
const util::NodeBasedDynamicGraph &node_based_graph;
|
2016-04-08 06:49:14 -04:00
|
|
|
const RoundaboutHandler roundabout_handler;
|
|
|
|
const MotorwayHandler motorway_handler;
|
|
|
|
const TurnHandler turn_handler;
|
2016-07-04 06:19:49 -04:00
|
|
|
const SliproadHandler sliproad_handler;
|
2016-12-07 14:26:34 -05:00
|
|
|
const SuppressModeHandler suppress_mode_handler;
|
2017-06-13 09:17:13 -04:00
|
|
|
const DrivewayHandler driveway_handler;
|
2017-10-31 17:04:03 -04:00
|
|
|
const StatisticsHandler statistics_handler;
|
2016-03-08 06:40:45 -05:00
|
|
|
|
|
|
|
// Utility function, setting basic turn types. Prepares for normal turn handling.
|
2016-04-08 06:49:14 -04:00
|
|
|
Intersection
|
|
|
|
setTurnTypes(const NodeID from, const EdgeID via_edge, Intersection intersection) const;
|
2016-03-08 06:40:45 -05:00
|
|
|
}; // class TurnAnalysis
|
2016-02-26 11:33:18 -05:00
|
|
|
|
2016-03-01 16:30:31 -05:00
|
|
|
} // namespace guidance
|
2016-02-25 08:40:26 -05:00
|
|
|
} // namespace osrm
|
|
|
|
|
2018-01-05 08:33:53 -05:00
|
|
|
#endif // OSRM_GUIDANCE_TURN_ANALYSIS
|