/
srv
/
osrm
/
osrm-backend
/
include
/
guidance
/
/srv/osrm/osrm-backend/include/guidance
mkdir
upload
Name
Size
Mode
Actions
constants.hpp
1265
0644
edit
dl
rm
driveway_handler.hpp
1540
0644
edit
dl
rm
files.hpp
1996
0644
edit
dl
rm
guidance_processing.hpp
2161
0644
edit
dl
rm
intersection.hpp
4933
0644
edit
dl
rm
intersection_handler.hpp
30075
0644
edit
dl
rm
is_through_street.hpp
2392
0644
edit
dl
rm
motorway_handler.hpp
2229
0644
edit
dl
rm
parsing_toolkit.hpp
3571
0644
edit
dl
rm
roundabout_handler.hpp
3374
0644
edit
dl
rm
roundabout_type.hpp
510
0644
edit
dl
rm
segregated_intersection_classification.hpp
677
0644
edit
dl
rm
serialization.hpp
1966
0644
edit
dl
rm
sliproad_handler.hpp
3683
0644
edit
dl
rm
statistics_handler.hpp
4235
0644
edit
dl
rm
suppress_mode_handler.hpp
1765
0644
edit
dl
rm
turn_analysis.hpp
2838
0644
edit
dl
rm
turn_bearing.hpp
777
0644
edit
dl
rm
turn_classification.hpp
535
0644
edit
dl
rm
turn_data_container.hpp
4326
0644
edit
dl
rm
turn_discovery.hpp
1509
0644
edit
dl
rm
turn_handler.hpp
4137
0644
edit
dl
rm
turn_instruction.hpp
16737
0644
edit
dl
rm
turn_lane_augmentation.hpp
507
0644
edit
dl
rm
turn_lane_data.hpp
1403
0644
edit
dl
rm
turn_lane_handler.hpp
6321
0644
edit
dl
rm
turn_lane_matcher.hpp
2047
0644
edit
dl
rm
Edit:
/srv/osrm/osrm-backend/include/guidance/turn_lane_handler.hpp
(6321B)
#ifndef OSRM_GUIDANCE_TURN_LANE_HANDLER_HPP_ #define OSRM_GUIDANCE_TURN_LANE_HANDLER_HPP_ #include "extractor/name_table.hpp" #include "extractor/query_node.hpp" #include "extractor/turn_lane_types.hpp" #include "guidance/intersection.hpp" #include "guidance/turn_analysis.hpp" #include "guidance/turn_lane_data.hpp" #include "util/attributes.hpp" #include "util/guidance/turn_lanes.hpp" #include "util/node_based_graph.hpp" #include "util/typedefs.hpp" #include <atomic> #include <cstddef> #include <cstdint> #include <map> #include <string> #include <utility> #include <vector> namespace osrm::guidance::lanes { namespace { using TurnLaneScenario = enum TurnLaneScenario { SIMPLE, // a straightforward assignment PARTITION_LOCAL, // an assignment that requires partitioning, using local turns SIMPLE_PREVIOUS, // an assignemtnn using the turns specified at the previous road (e.g. // traffic light, lanes not drawn up to the intersection) PARTITION_PREVIOUS, // a set of lanes on a turn with a traffic island. The lanes for the // turn end at the previous turn (parts of it remain valid without being // shown again) SLIPROAD, // Sliproads are simple assignments that, for better visual representation should // include turns from other roads in their listings MERGE, // Merging Lanes NONE, // not a turn lane scenario at all INVALID, // some error might have occurred UNKNOWN, // UNKNOWN describes all cases that we are currently not able to handle NUM_SCENARIOS }; } // namespace class TurnLaneHandler { using UpgradableMutex = boost::interprocess::interprocess_upgradable_mutex; using ScopedReaderLock = boost::interprocess::sharable_lock<UpgradableMutex>; using ScopedWriterLock = boost::interprocess::scoped_lock<UpgradableMutex>; public: using LaneDataVector = std::vector<TurnLaneData>; TurnLaneHandler(const util::NodeBasedDynamicGraph &node_based_graph, const extractor::EdgeBasedNodeDataContainer &node_data_container, const std::vector<util::Coordinate> &node_coordinates, const extractor::CompressedEdgeContainer &compressed_geometries, const extractor::RestrictionMap &node_restriction_map, const std::unordered_set<NodeID> &barrier_nodes, const extractor::TurnLanesIndexedArray &turn_lanes_data, extractor::LaneDescriptionMap &lane_description_map, const TurnAnalysis &turn_analysis, util::guidance::LaneDataIdMap &id_map); ~TurnLaneHandler(); OSRM_ATTR_WARN_UNUSED Intersection assignTurnLanes(const NodeID at, const EdgeID via_edge, Intersection intersection); private: mutable std::atomic<std::size_t> count_handled; mutable std::atomic<std::size_t> count_called; // we need to be able to look at previous intersections to, in some cases, find the correct turn // lanes for a turn const util::NodeBasedDynamicGraph &node_based_graph; const extractor::EdgeBasedNodeDataContainer &node_data_container; const std::vector<util::Coordinate> &node_coordinates; const extractor::CompressedEdgeContainer &compressed_geometries; const extractor::RestrictionMap &node_restriction_map; const std::unordered_set<NodeID> &barrier_nodes; const extractor::TurnLanesIndexedArray &turn_lanes_data; std::vector<std::uint32_t> turn_lane_offsets; std::vector<extractor::TurnLaneType::Mask> turn_lane_masks; extractor::LaneDescriptionMap &lane_description_map; const TurnAnalysis &turn_analysis; util::guidance::LaneDataIdMap &id_map; // Find out which scenario we have to handle TurnLaneScenario deduceScenario(const NodeID at, const EdgeID via_edge, const Intersection &intersection, // Output Parameters to reduce repeated creation LaneDescriptionID &lane_description_id, LaneDataVector &lane_data, NodeID &previous_node, EdgeID &previous_id, Intersection &previous_intersection, LaneDataVector &previous_lane_data, LaneDescriptionID &previous_description_id); // check whether we can handle an intersection bool isSimpleIntersection(const LaneDataVector &turn_lane_data, const Intersection &intersection) const; // in case of a simple intersection, assign the lane entries OSRM_ATTR_WARN_UNUSED Intersection simpleMatchTuplesToTurns(Intersection intersection, const LaneDataVector &lane_data, const LaneDescriptionID lane_string_id); // partition lane data into lane data relevant at current turn and at next turn OSRM_ATTR_WARN_UNUSED std::pair<TurnLaneHandler::LaneDataVector, TurnLaneHandler::LaneDataVector> partitionLaneData( const NodeID at, LaneDataVector turn_lane_data, const Intersection &intersection) const; // Sliproad turns have a separated lane to the right/left of other depicted lanes. These lanes // are not necessarily separated clearly from the rest of the way. As a result, we combine both // lane entries for our output, while performing the matching with the separated lanes only. OSRM_ATTR_WARN_UNUSED Intersection handleSliproadTurn(Intersection intersection, const LaneDescriptionID lane_description_id, LaneDataVector lane_data, const Intersection &previous_intersection); // get the lane data for an intersection void extractLaneData(const EdgeID via_edge, LaneDescriptionID &lane_description_id, LaneDataVector &lane_data) const; }; } // namespace osrm::guidance::lanes #endif // OSRM_EXTRACTOR_GUIDANCE_TURN_LANE_HANDLER_HPP_
Save
cmd:
run