fixes
This commit is contained in:
parent
181dbe8493
commit
a5ee7e78f6
@ -95,6 +95,7 @@ NodeBasedDynamicGraphFromImportEdges(int number_of_nodes, std::vector<ImportEdge
|
|||||||
edge.data.type = import_edge.type;
|
edge.data.type = import_edge.type;
|
||||||
edge.data.isAccessRestricted = import_edge.access_restricted;
|
edge.data.isAccessRestricted = import_edge.access_restricted;
|
||||||
edge.data.travel_mode = import_edge.travel_mode;
|
edge.data.travel_mode = import_edge.travel_mode;
|
||||||
|
|
||||||
edges_list.push_back(edge);
|
edges_list.push_back(edge);
|
||||||
|
|
||||||
if (!import_edge.is_split)
|
if (!import_edge.is_split)
|
||||||
|
@ -54,7 +54,7 @@ struct ExtractionWay
|
|||||||
isAccessRestricted = false;
|
isAccessRestricted = false;
|
||||||
ignoreInGrid = false;
|
ignoreInGrid = false;
|
||||||
travel_mode = 1;
|
travel_mode = 1;
|
||||||
backward_travel_mode = 0;
|
backward_travel_mode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Directions
|
enum Directions
|
||||||
|
@ -114,9 +114,6 @@ void ExtractorCallbacks::ProcessWay(ExtractionWay &parsed_way)
|
|||||||
|
|
||||||
bool split_edge = parsed_way.IsBidirectional() && parsed_way.HasDiffDirections();
|
bool split_edge = parsed_way.IsBidirectional() && parsed_way.HasDiffDirections();
|
||||||
|
|
||||||
//const bool split_edge =
|
|
||||||
// (parsed_way.backward_speed > 0) && (parsed_way.speed != parsed_way.backward_speed);
|
|
||||||
|
|
||||||
for (unsigned n = 0; n < (parsed_way.path.size() - 1); ++n)
|
for (unsigned n = 0; n < (parsed_way.path.size() - 1); ++n)
|
||||||
{
|
{
|
||||||
external_memory.all_edges_list.push_back(InternalExtractorEdge(
|
external_memory.all_edges_list.push_back(InternalExtractorEdge(
|
||||||
|
@ -229,6 +229,7 @@ template <class DataFacadeT> class BasicRoutingInterface
|
|||||||
const TurnInstruction turn_instruction = facade->GetTurnInstructionForEdgeID(ed.id);
|
const TurnInstruction turn_instruction = facade->GetTurnInstructionForEdgeID(ed.id);
|
||||||
const TravelMode travel_mode = facade->GetTravelModeForEdgeID(ed.id);
|
const TravelMode travel_mode = facade->GetTravelModeForEdgeID(ed.id);
|
||||||
|
|
||||||
|
|
||||||
if (!facade->EdgeIsCompressed(ed.id))
|
if (!facade->EdgeIsCompressed(ed.id))
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(!facade->EdgeIsCompressed(ed.id));
|
BOOST_ASSERT(!facade->EdgeIsCompressed(ed.id));
|
||||||
@ -257,7 +258,7 @@ template <class DataFacadeT> class BasicRoutingInterface
|
|||||||
BOOST_ASSERT(start_index <= end_index);
|
BOOST_ASSERT(start_index <= end_index);
|
||||||
for (std::size_t i = start_index; i < end_index; ++i)
|
for (std::size_t i = start_index; i < end_index; ++i)
|
||||||
{
|
{
|
||||||
unpacked_path.emplace_back(id_vector[i], name_index, TurnInstruction::NoTurn, 0, 0);
|
unpacked_path.emplace_back(id_vector[i], name_index, TurnInstruction::NoTurn, 0, travel_mode);
|
||||||
}
|
}
|
||||||
unpacked_path.back().turn_instruction = turn_instruction;
|
unpacked_path.back().turn_instruction = turn_instruction;
|
||||||
unpacked_path.back().segment_duration = ed.distance;
|
unpacked_path.back().segment_duration = ed.distance;
|
||||||
@ -304,7 +305,7 @@ template <class DataFacadeT> class BasicRoutingInterface
|
|||||||
phantom_node_pair.target_phantom.name_id,
|
phantom_node_pair.target_phantom.name_id,
|
||||||
TurnInstruction::NoTurn,
|
TurnInstruction::NoTurn,
|
||||||
0,
|
0,
|
||||||
0});
|
phantom_node_pair.target_phantom.travel_mode});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,13 +309,6 @@ template <class DataFacadeT> class ShortestPathRouting : public BasicRoutingInte
|
|||||||
}
|
}
|
||||||
raw_route_data.unpacked_path_segments.resize(packed_legs1.size());
|
raw_route_data.unpacked_path_segments.resize(packed_legs1.size());
|
||||||
|
|
||||||
//TODO - needed?
|
|
||||||
// set mode of first instruction
|
|
||||||
// if the best route started from the opposite edge, use backward mode rather than forward
|
|
||||||
//if( packed_legs1.front() == phantom_nodes_vector[0].source_phantom.reverse_node_id ) {
|
|
||||||
// phantom_nodes_vector[0].source_phantom.travel_mode = phantom_nodes_vector[0].source_phantom.backward_travel_mode;
|
|
||||||
//}
|
|
||||||
|
|
||||||
for (const std::size_t index : osrm::irange<std::size_t>(0, packed_legs1.size()))
|
for (const std::size_t index : osrm::irange<std::size_t>(0, packed_legs1.size()))
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(!phantom_nodes_vector.empty());
|
BOOST_ASSERT(!phantom_nodes_vector.empty());
|
||||||
|
@ -156,3 +156,15 @@ Feature: Testbot - Mode flag
|
|||||||
| waypoints | route | modes |
|
| waypoints | route | modes |
|
||||||
| a,0,d | ab,bc,cd | 1,3,1 |
|
| a,0,d | ab,bc,cd | 1,3,1 |
|
||||||
| d,0,a | cd,bc,ab | 1,4,1 |
|
| d,0,a | cd,bc,ab | 1,4,1 |
|
||||||
|
|
||||||
|
Scenario: Testbot - Modes when starting on opposite oneway
|
||||||
|
Given the node map
|
||||||
|
| a | b |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | oneway |
|
||||||
|
| ab | river | -1 |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | modes |
|
||||||
|
| b | a | ab | 4 |
|
||||||
|
Loading…
Reference in New Issue
Block a user