All good, but needs unpacking of start and end
This commit is contained in:
@@ -113,26 +113,26 @@ public:
|
||||
NodeID middle_node = UINT_MAX;
|
||||
forward_heap1.Insert(
|
||||
phantom_node_pair.startPhantom.forward_node_id,
|
||||
-phantom_node_pair.startPhantom.forward_weight,
|
||||
-phantom_node_pair.startPhantom.GetForwardWeightPlusOffset(),
|
||||
phantom_node_pair.startPhantom.forward_node_id
|
||||
);
|
||||
if(phantom_node_pair.startPhantom.isBidirected() ) {
|
||||
forward_heap1.Insert(
|
||||
phantom_node_pair.startPhantom.reverse_node_id,
|
||||
-phantom_node_pair.startPhantom.reverse_weight,
|
||||
-phantom_node_pair.startPhantom.GetReverseWeightPlusOffset(),
|
||||
phantom_node_pair.startPhantom.reverse_node_id
|
||||
);
|
||||
}
|
||||
|
||||
reverse_heap1.Insert(
|
||||
phantom_node_pair.targetPhantom.forward_node_id,
|
||||
phantom_node_pair.targetPhantom.forward_weight,
|
||||
phantom_node_pair.targetPhantom.GetForwardWeightPlusOffset(),
|
||||
phantom_node_pair.targetPhantom.forward_node_id
|
||||
);
|
||||
if(phantom_node_pair.targetPhantom.isBidirected() ) {
|
||||
reverse_heap1.Insert(
|
||||
phantom_node_pair.targetPhantom.reverse_node_id,
|
||||
phantom_node_pair.targetPhantom.reverse_weight,
|
||||
phantom_node_pair.targetPhantom.GetReverseWeightPlusOffset(),
|
||||
phantom_node_pair.targetPhantom.reverse_node_id
|
||||
);
|
||||
}
|
||||
|
||||
@@ -202,7 +202,8 @@ public:
|
||||
BOOST_ASSERT_MSG(!ed.shortcut, "original edge flagged as shortcut");
|
||||
unsigned name_index = facade->GetNameIndexFromEdgeID(ed.id);
|
||||
TurnInstruction turn_instruction = facade->GetTurnInstructionForEdgeID(ed.id);
|
||||
//TODO: reorder to always iterate over a result vector
|
||||
|
||||
//TODO: refactor to iterate over a result vector in both cases
|
||||
if ( !facade->EdgeIsCompressed(ed.id) ){
|
||||
SimpleLogger().Write() << "Edge " << ed.id << " is not compressed, smaller_edge_id: " << smaller_edge_id;
|
||||
BOOST_ASSERT( !facade->EdgeIsCompressed(ed.id) );
|
||||
@@ -218,10 +219,17 @@ public:
|
||||
SimpleLogger().Write() << "Edge " << ed.id << " is compressed";
|
||||
std::vector<unsigned> id_vector;
|
||||
facade->GetUncompressedGeometry(ed.id, id_vector);
|
||||
BOOST_FOREACH(const unsigned coordinate_id, id_vector){
|
||||
//TODO: unpack entire geometry
|
||||
//TODO: set distance to 0, see if works
|
||||
if( unpacked_path.empty() ) {
|
||||
SimpleLogger().Write(logDEBUG) << "first segment(" << facade->GetEscapedNameForNameID(ed.id) << ") is packed";
|
||||
|
||||
}
|
||||
|
||||
// if( recursion_stack.empty() ) {
|
||||
// SimpleLogger().Write(logDEBUG) << "last segment is packed";
|
||||
// }
|
||||
|
||||
BOOST_FOREACH(const unsigned coordinate_id, id_vector){
|
||||
//TODO: skip if first edge is compressed until start point is reached
|
||||
unpacked_path.push_back(
|
||||
PathData(
|
||||
coordinate_id,
|
||||
@@ -238,6 +246,8 @@ public:
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
inline void UnpackEdge(
|
||||
|
||||
@@ -109,12 +109,12 @@ public:
|
||||
|
||||
forward_heap1.Insert(
|
||||
phantom_node_pair.startPhantom.forward_node_id,
|
||||
distance1-phantom_node_pair.startPhantom.forward_weight,
|
||||
distance1-phantom_node_pair.startPhantom.GetForwardWeightPlusOffset(),
|
||||
phantom_node_pair.startPhantom.forward_node_id
|
||||
);
|
||||
forward_heap2.Insert(
|
||||
phantom_node_pair.startPhantom.forward_node_id,
|
||||
distance1-phantom_node_pair.startPhantom.forward_weight,
|
||||
distance1-phantom_node_pair.startPhantom.GetForwardWeightPlusOffset(),
|
||||
phantom_node_pair.startPhantom.forward_node_id
|
||||
);
|
||||
}
|
||||
@@ -122,12 +122,12 @@ public:
|
||||
BOOST_ASSERT(phantom_node_pair.startPhantom.reverse_node_id != UINT_MAX);
|
||||
forward_heap1.Insert(
|
||||
phantom_node_pair.startPhantom.reverse_node_id,
|
||||
distance2-phantom_node_pair.startPhantom.reverse_weight,
|
||||
distance2-phantom_node_pair.startPhantom.GetReverseWeightPlusOffset(),
|
||||
phantom_node_pair.startPhantom.reverse_node_id
|
||||
);
|
||||
forward_heap2.Insert(
|
||||
phantom_node_pair.startPhantom.reverse_node_id,
|
||||
distance2-phantom_node_pair.startPhantom.reverse_weight,
|
||||
distance2-phantom_node_pair.startPhantom.GetReverseWeightPlusOffset(),
|
||||
phantom_node_pair.startPhantom.reverse_node_id
|
||||
);
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
//insert new backward nodes into backward heap, unadjusted.
|
||||
reverse_heap1.Insert(
|
||||
phantom_node_pair.targetPhantom.forward_node_id,
|
||||
phantom_node_pair.targetPhantom.forward_weight,
|
||||
phantom_node_pair.targetPhantom.GetForwardWeightPlusOffset(),
|
||||
phantom_node_pair.targetPhantom.forward_node_id
|
||||
);
|
||||
BOOST_ASSERT(phantom_node_pair.targetPhantom.forward_node_id != UINT_MAX);
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
BOOST_ASSERT(phantom_node_pair.startPhantom.forward_node_id != UINT_MAX);
|
||||
reverse_heap2.Insert(
|
||||
phantom_node_pair.targetPhantom.reverse_node_id,
|
||||
phantom_node_pair.targetPhantom.reverse_weight,
|
||||
phantom_node_pair.targetPhantom.GetReverseWeightPlusOffset(),
|
||||
phantom_node_pair.targetPhantom.reverse_node_id
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user