2016-02-25 08:40:26 -05:00
|
|
|
#ifndef OSRM_EXTRACTOR_TURN_ANALYSIS
|
|
|
|
#define OSRM_EXTRACTOR_TURN_ANALYSIS
|
|
|
|
|
2016-03-23 08:04:23 -04:00
|
|
|
#include "extractor/compressed_edge_container.hpp"
|
2017-06-13 09:17:13 -04:00
|
|
|
#include "extractor/guidance/driveway_handler.hpp"
|
2016-04-08 06:49:14 -04:00
|
|
|
#include "extractor/guidance/intersection.hpp"
|
|
|
|
#include "extractor/guidance/intersection_generator.hpp"
|
2016-12-06 07:22:51 -05:00
|
|
|
#include "extractor/guidance/intersection_normalization_operation.hpp"
|
2016-11-09 10:52:22 -05:00
|
|
|
#include "extractor/guidance/intersection_normalizer.hpp"
|
2016-04-11 06:51:06 -04:00
|
|
|
#include "extractor/guidance/motorway_handler.hpp"
|
|
|
|
#include "extractor/guidance/roundabout_handler.hpp"
|
2016-07-04 06:19:49 -04:00
|
|
|
#include "extractor/guidance/sliproad_handler.hpp"
|
2016-12-07 14:26:34 -05:00
|
|
|
#include "extractor/guidance/suppress_mode_handler.hpp"
|
2016-03-23 08:04:23 -04:00
|
|
|
#include "extractor/guidance/turn_classification.hpp"
|
2016-04-08 06:49:14 -04:00
|
|
|
#include "extractor/guidance/turn_handler.hpp"
|
|
|
|
#include "extractor/query_node.hpp"
|
2016-02-25 08:40:26 -05:00
|
|
|
#include "extractor/restriction_map.hpp"
|
2016-04-22 05:31:46 -04:00
|
|
|
#include "extractor/suffix_table.hpp"
|
2016-02-25 08:40:26 -05:00
|
|
|
|
2016-11-09 10:52:22 -05:00
|
|
|
#include "util/attributes.hpp"
|
2016-03-16 10:47:33 -04:00
|
|
|
#include "util/name_table.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
|
|
|
|
{
|
|
|
|
namespace extractor
|
|
|
|
{
|
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,
|
2017-04-02 19:58:06 -04:00
|
|
|
const std::vector<util::Coordinate> &coordinates,
|
2016-03-08 06:40:45 -05:00
|
|
|
const RestrictionMap &restriction_map,
|
|
|
|
const std::unordered_set<NodeID> &barrier_nodes,
|
2016-03-16 10:47:33 -04:00
|
|
|
const CompressedEdgeContainer &compressed_edge_container,
|
2016-04-22 05:31:46 -04:00
|
|
|
const util::NameTable &name_table,
|
2016-07-18 09:34:12 -04:00
|
|
|
const SuffixTable &street_name_suffix_table,
|
|
|
|
const ProfileProperties &profile_properties);
|
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;
|
|
|
|
|
2016-11-09 10:52:22 -05:00
|
|
|
/*
|
|
|
|
* Returns a normalized intersection without any assigned turn types.
|
|
|
|
* This intersection can be used as input for intersection classification, turn lane assignment
|
|
|
|
* and similar.
|
|
|
|
*/
|
2016-11-18 03:38:26 -05:00
|
|
|
struct ShapeResult
|
|
|
|
{
|
|
|
|
// the basic shape, containing all turns
|
|
|
|
IntersectionShape intersection_shape;
|
2016-12-06 07:22:51 -05:00
|
|
|
// normalized shape, merged some roads into others, adjusted bearings
|
|
|
|
// see intersection_normalizer for further explanations
|
|
|
|
IntersectionNormalizer::NormalizationResult annotated_normalized_shape;
|
2016-11-18 03:38:26 -05:00
|
|
|
};
|
2016-11-09 10:52:22 -05:00
|
|
|
OSRM_ATTR_WARN_UNUSED
|
2016-11-18 03:38:26 -05:00
|
|
|
ShapeResult ComputeIntersectionShapes(const NodeID node_at_center_of_intersection) const;
|
2016-11-09 10:52:22 -05:00
|
|
|
|
2016-11-18 03:38:26 -05:00
|
|
|
// Select turn types based on the intersection shape
|
2016-11-09 10:52:22 -05:00
|
|
|
OSRM_ATTR_WARN_UNUSED
|
2016-11-18 03:38:26 -05:00
|
|
|
Intersection AssignTurnTypes(const NodeID from_node,
|
|
|
|
const EdgeID via_eid,
|
|
|
|
const IntersectionView &intersection) const;
|
2016-11-15 05:21:26 -05:00
|
|
|
|
2016-11-09 10:52:22 -05:00
|
|
|
const IntersectionGenerator &GetIntersectionGenerator() const;
|
2016-04-26 07:27:40 -04: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 IntersectionGenerator intersection_generator;
|
2016-11-09 10:52:22 -05:00
|
|
|
const IntersectionNormalizer intersection_normalizer;
|
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;
|
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 extractor
|
|
|
|
} // namespace osrm
|
|
|
|
|
|
|
|
#endif // OSRM_EXTRACTOR_TURN_ANALYSIS
|