Skip to content

Commit

Permalink
Remove usage of IntersectionGenerator in EBGF
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase committed Nov 30, 2017
1 parent ab218c4 commit a9f2011
Show file tree
Hide file tree
Showing 16 changed files with 589 additions and 914 deletions.
3 changes: 1 addition & 2 deletions features/car/conditional_restrictions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ Feature: Car - Turn restrictions
| a | c | albic,dobe,dobe,albic,albic | depart,turn left,continue uturn,turn left,arrive |
| a | e | albic,dobe,dobe | depart,turn left,arrive |

@no_turning @conditionals
@no_turning @conditionals @restriction-way
Scenario: Car - Conditional restriction with multiple time windows
Given the extract extra arguments "--parse-conditional-restrictions"
# 5pm Wed 02 May, 2017 GMT
Expand Down Expand Up @@ -1054,4 +1054,3 @@ Feature: Car - Turn restrictions
| a | f | ab,be,ef,ef | depart,turn right,turn left,arrive | a,b,e,f |
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |

20 changes: 10 additions & 10 deletions features/car/restrictions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ Feature: Car - Turn restrictions
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |

@restriction @overlap
@restriction-way @overlap
Scenario: Car - prohibit turn
Given the node map
"""
Expand Down Expand Up @@ -710,7 +710,7 @@ Feature: Car - Turn restrictions
| a | j | left,first,right,right |
| f | e | right,third,left,left |

@restriction
@restriction-way
Scenario: Car - allow only turn
Given the node map
"""
Expand Down Expand Up @@ -742,7 +742,7 @@ Feature: Car - Turn restrictions
| c | d | bc,be,de,de | depart,turn left,turn right,arrive | c,b,e,d |
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |

@restriction
@restriction-way
Scenario: Car - allow only turn
Given the node map
"""
Expand Down Expand Up @@ -771,7 +771,7 @@ Feature: Car - Turn restrictions
| from | to | route |
| a | d | ab,be,de,de |

@restriction
@restriction-way
Scenario: Multi Way restriction
Given the node map
"""
Expand Down Expand Up @@ -808,7 +808,7 @@ Feature: Car - Turn restrictions
| from | to | route |
| a | h | horiz,vert,horiz,horiz |

@restriction
@restriction-way
Scenario: Multi-Way overlapping single-way
Given the node map
"""
Expand Down Expand Up @@ -847,7 +847,7 @@ Feature: Car - Turn restrictions
| h | d | hfb,abcd,abcd | depart,end of road right,arrive | h,b,d |


@restriction
@restriction-way
Scenario: Car - prohibit turn, traffic lights
Given the node map
"""
Expand Down Expand Up @@ -890,7 +890,7 @@ Feature: Car - Turn restrictions
| c | f | bc,be,ef,ef | depart,turn left,turn left,arrive | c,b,e,f |


@restriction @overlap @geometry
@restriction-way @overlap @geometry
Scenario: Geometry
Given the node map
"""
Expand Down Expand Up @@ -925,7 +925,7 @@ Feature: Car - Turn restrictions
| c | d | bc,bge,de,de |
| c | f | bc,bge,de,de,ef,ef |

@restriction @overlap @geometry @traffic-signals
@restriction-way @overlap @geometry @traffic-signals
Scenario: Geometry
Given the node map
"""
Expand Down Expand Up @@ -967,7 +967,7 @@ Feature: Car - Turn restrictions
| c | f | bc,bge,de,de,ef,ef |

# don't crash hard on invalid restrictions
@restriction @invalid
@restriction-way @invalid
Scenario: Geometry
Given the node map
"""
Expand Down Expand Up @@ -999,7 +999,7 @@ Feature: Car - Turn restrictions
| a | f | ab,be,ef,ef |


@restriction @overlap @geometry
@restriction @restriction-way @overlap @geometry
Scenario: Duplicated restriction
Given the node map
"""
Expand Down
4 changes: 4 additions & 0 deletions features/guidance/merge-segregated-roads.feature
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,16 @@ Feature: Merge Segregated Roads
a
|
b
/ \
c h
| |
| |
| |
| |
| |
| |
d g
\ /
e
|
f
Expand Down
12 changes: 6 additions & 6 deletions features/guidance/turn-angles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -961,12 +961,12 @@ Feature: Simple Turns
g
.
.
.
.
f
h .
. .
. j
.
.
h f
.
. .
. j
. .
c
. . .
Expand Down
2 changes: 1 addition & 1 deletion include/contractor/contracted_edge_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct ContractedEdgeContainer
edges.insert(edges.end(), new_edges.begin(), new_end);
auto edges_size = edges.size();
auto new_edges_size = std::distance(new_edges.begin(), new_end);
BOOST_ASSERT(edges_size >= new_edges_size);
BOOST_ASSERT(edges_size >= static_cast<std::size_t>(new_edges_size));
flags.resize(edges_size);
std::fill(flags.begin() + edges_size - new_edges_size, flags.end(), flag);

Expand Down
125 changes: 0 additions & 125 deletions include/extractor/guidance/intersection_normalizer.hpp

This file was deleted.

4 changes: 0 additions & 4 deletions include/extractor/guidance/roundabout_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ class RoundaboutHandler : public IntersectionHandler
const EdgeID via_eid,
const Intersection &intersection) const;

void invalidateExitAgainstDirection(const NodeID from_nid,
const EdgeID via_eid,
Intersection &intersection) const;

// decide whether we lookk at a roundabout or a rotary
RoundaboutType getRoundaboutType(const NodeID nid) const;

Expand Down
18 changes: 0 additions & 18 deletions include/extractor/guidance/turn_analysis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "extractor/guidance/intersection.hpp"
#include "extractor/guidance/intersection_generator.hpp"
#include "extractor/guidance/intersection_normalization_operation.hpp"
#include "extractor/guidance/intersection_normalizer.hpp"
#include "extractor/guidance/motorway_handler.hpp"
#include "extractor/guidance/roundabout_handler.hpp"
#include "extractor/guidance/sliproad_handler.hpp"
Expand Down Expand Up @@ -56,22 +55,6 @@ class TurnAnalysis
Intersection operator()(const NodeID node_prior_to_intersection,
const EdgeID entering_via_edge) const;

/*
* Returns a normalized intersection without any assigned turn types.
* This intersection can be used as input for intersection classification, turn lane assignment
* and similar.
*/
struct ShapeResult
{
// the basic shape, containing all turns
IntersectionShape intersection_shape;
// normalized shape, merged some roads into others, adjusted bearings
// see intersection_normalizer for further explanations
IntersectionNormalizer::NormalizationResult annotated_normalized_shape;
};
OSRM_ATTR_WARN_UNUSED
ShapeResult ComputeIntersectionShapes(const NodeID node_at_center_of_intersection) const;

// Select turn types based on the intersection shape
OSRM_ATTR_WARN_UNUSED
Intersection AssignTurnTypes(const NodeID from_node,
Expand All @@ -83,7 +66,6 @@ class TurnAnalysis
private:
const util::NodeBasedDynamicGraph &node_based_graph;
const IntersectionGenerator intersection_generator;
const IntersectionNormalizer intersection_normalizer;
const RoundaboutHandler roundabout_handler;
const MotorwayHandler motorway_handler;
const TurnHandler turn_handler;
Expand Down
31 changes: 22 additions & 9 deletions include/extractor/intersection/intersection_analysis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define OSRM_EXTRACTOR_INTERSECTION_INTERSECTION_ANALYSIS_HPP

#include "extractor/compressed_edge_container.hpp"
#include "extractor/guidance/mergable_road_detector.hpp"
#include "extractor/guidance/turn_lane_types.hpp"
#include "extractor/intersection/intersection_edge.hpp"
#include "extractor/restriction_index.hpp"
Expand All @@ -25,24 +26,36 @@ IntersectionEdges getIncomingEdges(const util::NodeBasedDynamicGraph &graph,
IntersectionEdges getOutgoingEdges(const util::NodeBasedDynamicGraph &graph,
const NodeID intersection);

IntersectionEdgeBearings
getIntersectionBearings(const util::NodeBasedDynamicGraph &graph,
const extractor::CompressedEdgeContainer &compressed_geometries,
const std::vector<util::Coordinate> &node_coordinates,
const NodeID intersection);
std::pair<IntersectionEdgeGeometries, std::unordered_set<EdgeID>>
getIntersectionGeometries(const util::NodeBasedDynamicGraph &graph,
const extractor::CompressedEdgeContainer &compressed_geometries,
const std::vector<util::Coordinate> &node_coordinates,
const guidance::MergableRoadDetector &detector,
const NodeID intersection);

guidance::IntersectionView
convertToIntersectionView(const util::NodeBasedDynamicGraph &graph,
const EdgeBasedNodeDataContainer &node_data_container,
const RestrictionMap &restriction_map,
const std::unordered_set<NodeID> &barrier_nodes,
const IntersectionEdgeGeometries &edge_geometries,
const guidance::TurnLanesIndexedArray &turn_lanes_data,
const IntersectionEdge &incoming_edge,
const IntersectionEdges &outgoing_edges,
const std::unordered_set<EdgeID> &merged_edges);

bool isTurnAllowed(const util::NodeBasedDynamicGraph &graph,
const EdgeBasedNodeDataContainer &node_data_container,
const RestrictionMap &restriction_map,
const std::unordered_set<NodeID> &barrier_nodes,
const IntersectionEdgeBearings &bearings,
const IntersectionEdgeGeometries &geometries,
const guidance::TurnLanesIndexedArray &turn_lanes_data,
const IntersectionEdge &from,
const IntersectionEdge &to);

double computeTurnAngle(const IntersectionEdgeBearings &bearings,
const IntersectionEdge &from,
const IntersectionEdge &to);
double findEdgeBearing(const IntersectionEdgeGeometries &geometries, const EdgeID &edge);

double findEdgeLength(const IntersectionEdgeGeometries &geometries, const EdgeID &edge);
}
}
}
Expand Down
Loading

0 comments on commit a9f2011

Please sign in to comment.