unpacking of target segment works
This commit is contained in:
parent
874c579f86
commit
eca09e6c81
@ -128,13 +128,6 @@ EdgeBasedGraphFactory::EdgeBasedGraphFactory(
|
|||||||
edge.data.SwapDirectionFlags();
|
edge.data.SwapDirectionFlags();
|
||||||
edges_list.push_back( edge );
|
edges_list.push_back( edge );
|
||||||
}
|
}
|
||||||
|
|
||||||
// if( import_edge.source() == 150903 || import_edge.target() == 150903 ) {
|
|
||||||
// SimpleLogger().Write(logDEBUG) << "[" << edges_list.size() << "] (" << import_edge.source() << "," << import_edge.target() << "), w: " << import_edge.weight();
|
|
||||||
// if( import_edge.IsSplit() ) {
|
|
||||||
// SimpleLogger().Write(logDEBUG) << "edge split: (" << import_edge.source() << "," << import_edge.target() << ")";
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ImportEdge>().swap(input_edge_list);
|
std::vector<ImportEdge>().swap(input_edge_list);
|
||||||
@ -297,7 +290,8 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(
|
|||||||
BOOST_ASSERT( e1 != SPECIAL_EDGEID );
|
BOOST_ASSERT( e1 != SPECIAL_EDGEID );
|
||||||
|
|
||||||
// find forward edge id and
|
// find forward edge id and
|
||||||
// const EdgeID e1 = m_node_based_graph->FindEdge(u, v);
|
const EdgeID e1b = m_node_based_graph->FindEdge(u, v);
|
||||||
|
BOOST_ASSERT( e1 == e1b );
|
||||||
|
|
||||||
BOOST_ASSERT( e1 != SPECIAL_EDGEID );
|
BOOST_ASSERT( e1 != SPECIAL_EDGEID );
|
||||||
const EdgeData & forward_data = m_node_based_graph->GetEdgeData(e1);
|
const EdgeData & forward_data = m_node_based_graph->GetEdgeData(e1);
|
||||||
@ -322,8 +316,16 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOST_ASSERT( m_geometry_compressor.HasEntryForID(e1) == m_geometry_compressor.HasEntryForID(e2) );
|
BOOST_ASSERT( m_geometry_compressor.HasEntryForID(e1) == m_geometry_compressor.HasEntryForID(e2) );
|
||||||
|
|
||||||
if( m_geometry_compressor.HasEntryForID(e1) ) {
|
if( m_geometry_compressor.HasEntryForID(e1) ) {
|
||||||
|
if(forward_data.edgeBasedNodeID == 16176) {
|
||||||
|
SimpleLogger().Write(logDEBUG) << "reverse_data.edgeBasedNodeID=" << reverse_data.edgeBasedNodeID;
|
||||||
|
SimpleLogger().Write(logDEBUG) << "u: " << u << ", v: " << v << " at " << m_node_info_list.at(u).lat/COORDINATE_PRECISION << ","
|
||||||
|
<< m_node_info_list.at(u).lon/COORDINATE_PRECISION << "<->" << m_node_info_list.at(v).lat/COORDINATE_PRECISION << ","
|
||||||
|
<< m_node_info_list.at(v).lon/COORDINATE_PRECISION;
|
||||||
|
SimpleLogger().Write(logDEBUG) << "pos(" << e1 << ")=" << m_geometry_compressor.GetPositionForID(e1);
|
||||||
|
SimpleLogger().Write(logDEBUG) << "pos(" << e2 << ")=" << m_geometry_compressor.GetPositionForID(e2);
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_ASSERT( m_geometry_compressor.HasEntryForID(e2) );
|
BOOST_ASSERT( m_geometry_compressor.HasEntryForID(e2) );
|
||||||
|
|
||||||
// reconstruct geometry and put in each individual edge with its offset
|
// reconstruct geometry and put in each individual edge with its offset
|
||||||
@ -399,10 +401,9 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(
|
|||||||
reverse_geometry[geometry_size-1-i].second,
|
reverse_geometry[geometry_size-1-i].second,
|
||||||
forward_dist_prefix_sum[i],
|
forward_dist_prefix_sum[i],
|
||||||
reverse_dist_prefix_sum[geometry_size-1-i],
|
reverse_dist_prefix_sum[geometry_size-1-i],
|
||||||
|
m_geometry_compressor.GetPositionForID(e1),
|
||||||
i,
|
i,
|
||||||
geometry_size-1-i,
|
belongs_to_tiny_cc
|
||||||
belongs_to_tiny_cc,
|
|
||||||
true
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
current_edge_start_coordinate_id = current_edge_target_coordinate_id;
|
current_edge_start_coordinate_id = current_edge_target_coordinate_id;
|
||||||
@ -419,7 +420,7 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(
|
|||||||
v != m_edge_based_node_list.back().u
|
v != m_edge_based_node_list.back().u
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
//TODO: Manually reconstruct last edge.
|
|
||||||
BOOST_ASSERT( current_edge_start_coordinate_id == v );
|
BOOST_ASSERT( current_edge_start_coordinate_id == v );
|
||||||
BOOST_ASSERT( m_edge_based_node_list.back().IsCompressed() );
|
BOOST_ASSERT( m_edge_based_node_list.back().IsCompressed() );
|
||||||
|
|
||||||
@ -459,10 +460,9 @@ void EdgeBasedGraphFactory::InsertEdgeBasedNode(
|
|||||||
reverse_data.distance,
|
reverse_data.distance,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
SPECIAL_EDGEID,
|
||||||
0,
|
0,
|
||||||
0,
|
belongs_to_tiny_cc
|
||||||
belongs_to_tiny_cc,
|
|
||||||
false
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
BOOST_ASSERT( !m_edge_based_node_list.back().IsCompressed() );
|
BOOST_ASSERT( !m_edge_based_node_list.back().IsCompressed() );
|
||||||
@ -688,7 +688,7 @@ void EdgeBasedGraphFactory::Run(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// BOOST_ASSERT( u < v );
|
BOOST_ASSERT( u < v );
|
||||||
BOOST_ASSERT( edge_data.type != SHRT_MAX );
|
BOOST_ASSERT( edge_data.type != SHRT_MAX );
|
||||||
|
|
||||||
//Note: edges that end on barrier nodes or on a turn restriction
|
//Note: edges that end on barrier nodes or on a turn restriction
|
||||||
|
@ -64,7 +64,6 @@ unsigned GeometryCompressor::GetPositionForID(const EdgeID edge_id) const {
|
|||||||
void GeometryCompressor::SerializeInternalVector(
|
void GeometryCompressor::SerializeInternalVector(
|
||||||
const std::string & path
|
const std::string & path
|
||||||
) const {
|
) const {
|
||||||
//TODO: remove super-trivial geometries
|
|
||||||
|
|
||||||
std::ofstream geometry_out_stream( path.c_str(), std::ios::binary );
|
std::ofstream geometry_out_stream( path.c_str(), std::ios::binary );
|
||||||
const unsigned number_of_compressed_geometries = m_compressed_geometries.size()+1;
|
const unsigned number_of_compressed_geometries = m_compressed_geometries.size()+1;
|
||||||
@ -129,6 +128,7 @@ void GeometryCompressor::CompressEdge(
|
|||||||
const EdgeWeight weight1,
|
const EdgeWeight weight1,
|
||||||
const EdgeWeight weight2
|
const EdgeWeight weight2
|
||||||
) {
|
) {
|
||||||
|
//TODO: remove super-trivial geometries
|
||||||
|
|
||||||
BOOST_ASSERT( SPECIAL_EDGEID != edge_id_1 );
|
BOOST_ASSERT( SPECIAL_EDGEID != edge_id_1 );
|
||||||
BOOST_ASSERT( SPECIAL_EDGEID != edge_id_2 );
|
BOOST_ASSERT( SPECIAL_EDGEID != edge_id_2 );
|
||||||
|
@ -18,14 +18,13 @@ struct EdgeBasedNode {
|
|||||||
u(SPECIAL_NODEID),
|
u(SPECIAL_NODEID),
|
||||||
v(SPECIAL_NODEID),
|
v(SPECIAL_NODEID),
|
||||||
name_id(0),
|
name_id(0),
|
||||||
forward_weight(std::numeric_limits<int>::max() >> 1),
|
forward_weight(INVALID_EDGE_WEIGHT >> 1),
|
||||||
reverse_weight(std::numeric_limits<int>::max() >> 1),
|
reverse_weight(INVALID_EDGE_WEIGHT >> 1),
|
||||||
forward_offset(0),
|
forward_offset(0),
|
||||||
reverse_offset(0),
|
reverse_offset(0),
|
||||||
|
packed_geometry_id(SPECIAL_EDGEID),
|
||||||
fwd_segment_position( std::numeric_limits<unsigned short>::max() ),
|
fwd_segment_position( std::numeric_limits<unsigned short>::max() ),
|
||||||
rev_segment_position( std::numeric_limits<unsigned short>::max() >> 2 ),
|
belongsToTinyComponent(false)
|
||||||
belongsToTinyComponent(false),
|
|
||||||
is_compressed(false)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
explicit EdgeBasedNode(
|
explicit EdgeBasedNode(
|
||||||
@ -38,10 +37,9 @@ struct EdgeBasedNode {
|
|||||||
int reverse_weight,
|
int reverse_weight,
|
||||||
int forward_offset,
|
int forward_offset,
|
||||||
int reverse_offset,
|
int reverse_offset,
|
||||||
|
unsigned packed_geometry_id,
|
||||||
unsigned short fwd_segment_position,
|
unsigned short fwd_segment_position,
|
||||||
unsigned short rev_segment_position,
|
bool belongs_to_tiny_component
|
||||||
bool belongsToTinyComponent,
|
|
||||||
bool is_compressed
|
|
||||||
) :
|
) :
|
||||||
forward_edge_based_node_id(forward_edge_based_node_id),
|
forward_edge_based_node_id(forward_edge_based_node_id),
|
||||||
reverse_edge_based_node_id(reverse_edge_based_node_id),
|
reverse_edge_based_node_id(reverse_edge_based_node_id),
|
||||||
@ -52,23 +50,14 @@ struct EdgeBasedNode {
|
|||||||
reverse_weight(reverse_weight),
|
reverse_weight(reverse_weight),
|
||||||
forward_offset(forward_offset),
|
forward_offset(forward_offset),
|
||||||
reverse_offset(reverse_offset),
|
reverse_offset(reverse_offset),
|
||||||
|
packed_geometry_id(packed_geometry_id),
|
||||||
fwd_segment_position(fwd_segment_position),
|
fwd_segment_position(fwd_segment_position),
|
||||||
rev_segment_position(rev_segment_position),
|
belongsToTinyComponent(belongs_to_tiny_component)
|
||||||
belongsToTinyComponent(belongsToTinyComponent),
|
|
||||||
is_compressed(is_compressed)
|
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(
|
BOOST_ASSERT(
|
||||||
( forward_edge_based_node_id != SPECIAL_NODEID ) ||
|
( forward_edge_based_node_id != SPECIAL_NODEID ) ||
|
||||||
( reverse_edge_based_node_id != SPECIAL_NODEID )
|
( reverse_edge_based_node_id != SPECIAL_NODEID )
|
||||||
);
|
);
|
||||||
// if( forward_edge_based_node_id == SPECIAL_NODEID ) {
|
|
||||||
// using namespace std;
|
|
||||||
// swap( forward_edge_based_node_id, reverse_edge_based_node_id );
|
|
||||||
// swap( u, v );
|
|
||||||
// swap( forward_weight, reverse_weight );
|
|
||||||
// swap( forward_offset, reverse_offset );
|
|
||||||
// swap( fwd_segment_position, rev_segment_position );
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static double ComputePerpendicularDistance(
|
inline static double ComputePerpendicularDistance(
|
||||||
@ -149,7 +138,7 @@ struct EdgeBasedNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsCompressed() {
|
bool IsCompressed() {
|
||||||
return is_compressed;
|
return packed_geometry_id != SPECIAL_EDGEID;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the midpoint of the underlying edge.
|
// Returns the midpoint of the underlying edge.
|
||||||
@ -158,7 +147,7 @@ struct EdgeBasedNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NodeID forward_edge_based_node_id;
|
NodeID forward_edge_based_node_id;
|
||||||
NodeID reverse_edge_based_node_id;
|
NodeID reverse_edge_based_node_id; // needed for edge-expanded graph
|
||||||
NodeID u;
|
NodeID u;
|
||||||
NodeID v;
|
NodeID v;
|
||||||
unsigned name_id;
|
unsigned name_id;
|
||||||
|
@ -40,9 +40,9 @@ struct PhantomNode {
|
|||||||
reverse_weight(INVALID_EDGE_WEIGHT),
|
reverse_weight(INVALID_EDGE_WEIGHT),
|
||||||
forward_offset(0),
|
forward_offset(0),
|
||||||
reverse_offset(0),
|
reverse_offset(0),
|
||||||
|
packed_geometry_id(SPECIAL_EDGEID),
|
||||||
ratio(0.),
|
ratio(0.),
|
||||||
fwd_segment_position(0),
|
fwd_segment_position(0)
|
||||||
rev_segment_position(0)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
NodeID forward_node_id;
|
NodeID forward_node_id;
|
||||||
@ -52,10 +52,10 @@ struct PhantomNode {
|
|||||||
int reverse_weight;
|
int reverse_weight;
|
||||||
int forward_offset;
|
int forward_offset;
|
||||||
int reverse_offset;
|
int reverse_offset;
|
||||||
|
unsigned packed_geometry_id;
|
||||||
double ratio;
|
double ratio;
|
||||||
FixedPointCoordinate location;
|
FixedPointCoordinate location;
|
||||||
unsigned short fwd_segment_position;
|
unsigned short fwd_segment_position;
|
||||||
unsigned short rev_segment_position;
|
|
||||||
|
|
||||||
|
|
||||||
int GetForwardWeightPlusOffset() const {
|
int GetForwardWeightPlusOffset() const {
|
||||||
|
@ -690,15 +690,17 @@ public:
|
|||||||
)
|
)
|
||||||
) { //found a new minimum
|
) { //found a new minimum
|
||||||
min_dist = current_perpendicular_distance;
|
min_dist = current_perpendicular_distance;
|
||||||
|
//TODO: use assignment c'tor in PhantomNode
|
||||||
result_phantom_node.forward_node_id = current_edge.forward_edge_based_node_id;
|
result_phantom_node.forward_node_id = current_edge.forward_edge_based_node_id;
|
||||||
result_phantom_node.reverse_node_id = current_edge.reverse_edge_based_node_id;
|
result_phantom_node.reverse_node_id = current_edge.reverse_edge_based_node_id;
|
||||||
|
result_phantom_node.name_id = current_edge.name_id;
|
||||||
result_phantom_node.forward_weight = current_edge.forward_weight;
|
result_phantom_node.forward_weight = current_edge.forward_weight;
|
||||||
result_phantom_node.reverse_weight = current_edge.reverse_weight;
|
result_phantom_node.reverse_weight = current_edge.reverse_weight;
|
||||||
result_phantom_node.forward_offset = current_edge.forward_offset;
|
result_phantom_node.forward_offset = current_edge.forward_offset;
|
||||||
result_phantom_node.reverse_offset = current_edge.reverse_offset;
|
result_phantom_node.reverse_offset = current_edge.reverse_offset;
|
||||||
|
result_phantom_node.packed_geometry_id = current_edge.packed_geometry_id;
|
||||||
result_phantom_node.fwd_segment_position = current_edge.fwd_segment_position;
|
result_phantom_node.fwd_segment_position = current_edge.fwd_segment_position;
|
||||||
result_phantom_node.rev_segment_position = current_edge.rev_segment_position;
|
|
||||||
result_phantom_node.name_id = current_edge.name_id;
|
|
||||||
result_phantom_node.location = nearest;
|
result_phantom_node.location = nearest;
|
||||||
current_start_coordinate.lat = m_coordinate_list->at(current_edge.u).lat;
|
current_start_coordinate.lat = m_coordinate_list->at(current_edge.u).lat;
|
||||||
current_start_coordinate.lon = m_coordinate_list->at(current_edge.u).lon;
|
current_start_coordinate.lon = m_coordinate_list->at(current_edge.u).lon;
|
||||||
@ -767,6 +769,7 @@ public:
|
|||||||
SimpleLogger().Write(logDEBUG) << "fwd weight: " << result_phantom_node.forward_weight << ", rev weight: " << result_phantom_node.reverse_weight << ", ratio: " << result_phantom_node.ratio;
|
SimpleLogger().Write(logDEBUG) << "fwd weight: " << result_phantom_node.forward_weight << ", rev weight: " << result_phantom_node.reverse_weight << ", ratio: " << result_phantom_node.ratio;
|
||||||
SimpleLogger().Write(logDEBUG) << "bidirected: " << (result_phantom_node.isBidirected() ? "y" : "n");
|
SimpleLogger().Write(logDEBUG) << "bidirected: " << (result_phantom_node.isBidirected() ? "y" : "n");
|
||||||
SimpleLogger().Write(logDEBUG) << "name id: " << result_phantom_node.name_id;
|
SimpleLogger().Write(logDEBUG) << "name id: " << result_phantom_node.name_id;
|
||||||
|
SimpleLogger().Write(logDEBUG) << "geom id: " << result_phantom_node.packed_geometry_id;
|
||||||
|
|
||||||
return found_a_nearest_edge;
|
return found_a_nearest_edge;
|
||||||
}
|
}
|
||||||
|
@ -288,14 +288,16 @@ public:
|
|||||||
|
|
||||||
SimpleLogger().Write(logDEBUG) << "phantom_node_pair.startPhantom.forward_node_id: " << phantom_node_pair.startPhantom.forward_node_id;
|
SimpleLogger().Write(logDEBUG) << "phantom_node_pair.startPhantom.forward_node_id: " << phantom_node_pair.startPhantom.forward_node_id;
|
||||||
SimpleLogger().Write(logDEBUG) << "phantom_node_pair.startPhantom.reverse_node_id: " << phantom_node_pair.startPhantom.reverse_node_id;
|
SimpleLogger().Write(logDEBUG) << "phantom_node_pair.startPhantom.reverse_node_id: " << phantom_node_pair.startPhantom.reverse_node_id;
|
||||||
SimpleLogger().Write(logDEBUG) << "packed_shortest_path.front(): " << packed_shortest_path.front();
|
SimpleLogger().Write(logDEBUG) << "phantom_node_pair.targetPhantom.packed_geometry_id: " << phantom_node_pair.targetPhantom.packed_geometry_id;
|
||||||
// SimpleLogger().Write(logDEBUG) << "packed_shortest_path.back(): " << packed_shortest_path.back();
|
// SimpleLogger().Write(logDEBUG) << "packed_shortest_path.back(): " << packed_shortest_path.back();
|
||||||
|
|
||||||
super::UnpackPath(
|
super::UnpackPath(
|
||||||
packed_shortest_path,
|
packed_shortest_path,
|
||||||
phantom_node_pair.startPhantom.fwd_segment_position,
|
phantom_node_pair.startPhantom.fwd_segment_position,
|
||||||
(packed_shortest_path.front() != phantom_node_pair.startPhantom.forward_node_id),
|
(packed_shortest_path.front() != phantom_node_pair.startPhantom.forward_node_id),
|
||||||
phantom_node_pair.targetPhantom.fwd_segment_position,//( packed_forward_path.back() == phantom_node_pair.targetPhantom.forward_node_id ? 1 : -1 )*phantom_node_pair.targetPhantom.fwd_segment_position,
|
phantom_node_pair.targetPhantom.packed_geometry_id,
|
||||||
|
phantom_node_pair.targetPhantom.fwd_segment_position,
|
||||||
|
(packed_shortest_path.back() != phantom_node_pair.targetPhantom.forward_node_id),
|
||||||
raw_route_data.unpacked_path_segments.front()
|
raw_route_data.unpacked_path_segments.front()
|
||||||
);
|
);
|
||||||
raw_route_data.lengthOfShortestPath = upper_bound_to_shortest_path_distance;
|
raw_route_data.lengthOfShortestPath = upper_bound_to_shortest_path_distance;
|
||||||
@ -359,7 +361,7 @@ private:
|
|||||||
// unpack, supply correct offsets to packed start and end nodes.
|
// unpack, supply correct offsets to packed start and end nodes.
|
||||||
super::UnpackPath(
|
super::UnpackPath(
|
||||||
packed_s_v_path,
|
packed_s_v_path,
|
||||||
0, false, 0, //TODO: replace by real offsets
|
0, false, SPECIAL_EDGEID, 0, false, //TODO: replace by real offsets
|
||||||
unpacked_path
|
unpacked_path
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
) const {
|
) const {
|
||||||
const NodeID node = forward_heap.DeleteMin();
|
const NodeID node = forward_heap.DeleteMin();
|
||||||
const int distance = forward_heap.GetKey(node);
|
const int distance = forward_heap.GetKey(node);
|
||||||
SimpleLogger().Write() << (forward_direction ? "fwd" : "rev") << " settled (" << forward_heap.GetData( node ).parent << "," << node << ")=" << distance;
|
// SimpleLogger().Write() << (forward_direction ? "fwd" : "rev") << " settled (" << forward_heap.GetData( node ).parent << "," << node << ")=" << distance;
|
||||||
if(reverse_heap.WasInserted(node) ){
|
if(reverse_heap.WasInserted(node) ){
|
||||||
const int new_distance = reverse_heap.GetKey(node) + distance;
|
const int new_distance = reverse_heap.GetKey(node) + distance;
|
||||||
if(new_distance < *upper_bound ){
|
if(new_distance < *upper_bound ){
|
||||||
@ -136,11 +136,15 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//TODO: refactor parameters to only edge ids for start and end
|
||||||
inline void UnpackPath(
|
inline void UnpackPath(
|
||||||
const std::vector<NodeID> & packed_path,
|
const std::vector<NodeID> & packed_path,
|
||||||
int fwd_index_offset,
|
const int fwd_index_offset,
|
||||||
bool start_traversed_in_reverse,
|
const bool start_traversed_in_reverse,
|
||||||
int rev_index_offset,
|
const unsigned packed_geometry_id_of_last_edge,
|
||||||
|
const int rev_index_offset,
|
||||||
|
const bool target_traversed_in_reverse,
|
||||||
std::vector<PathData> & unpacked_path
|
std::vector<PathData> & unpacked_path
|
||||||
) const {
|
) const {
|
||||||
const unsigned packed_path_size = packed_path.size();
|
const unsigned packed_path_size = packed_path.size();
|
||||||
@ -223,7 +227,7 @@ public:
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
std::vector<unsigned> id_vector;
|
std::vector<unsigned> id_vector;
|
||||||
facade->GetUncompressedGeometry(ed.id, id_vector);
|
facade->GetUncompressedGeometry(facade->GetGeometryIndexForEdgeID(ed.id), id_vector);
|
||||||
|
|
||||||
const int start_index = ( unpacked_path.empty() ? ( ( start_traversed_in_reverse ) ? id_vector.size() - fwd_index_offset - 1 : fwd_index_offset ) : 0 );
|
const int start_index = ( unpacked_path.empty() ? ( ( start_traversed_in_reverse ) ? id_vector.size() - fwd_index_offset - 1 : fwd_index_offset ) : 0 );
|
||||||
const int end_index = id_vector.size();
|
const int end_index = id_vector.size();
|
||||||
@ -249,6 +253,31 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(SPECIAL_EDGEID != packed_geometry_id_of_last_edge) {
|
||||||
|
SimpleLogger().Write(logDEBUG) << "unpacking last segment " << packed_geometry_id_of_last_edge;
|
||||||
|
std::vector<unsigned> id_vector;
|
||||||
|
facade->GetUncompressedGeometry(packed_geometry_id_of_last_edge, id_vector);
|
||||||
|
const int start_index = 0;
|
||||||
|
const int end_index = rev_index_offset;
|
||||||
|
|
||||||
|
BOOST_ASSERT( start_index >= 0 );
|
||||||
|
BOOST_ASSERT( start_index <= end_index );
|
||||||
|
for(
|
||||||
|
unsigned i = start_index;
|
||||||
|
i < end_index;
|
||||||
|
++i
|
||||||
|
) {
|
||||||
|
SimpleLogger().Write(logDEBUG) << facade->GetCoordinateOfNode(id_vector[i]);
|
||||||
|
unpacked_path.push_back(
|
||||||
|
PathData(
|
||||||
|
id_vector[i],
|
||||||
|
0,
|
||||||
|
TurnInstructionsClass::NoTurn,
|
||||||
|
0
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void UnpackEdge(
|
inline void UnpackEdge(
|
||||||
@ -330,8 +359,7 @@ public:
|
|||||||
current_node_id = forward_heap.GetData(current_node_id).parent;
|
current_node_id = forward_heap.GetData(current_node_id).parent;
|
||||||
packed_path.push_back(current_node_id);
|
packed_path.push_back(current_node_id);
|
||||||
}
|
}
|
||||||
//throw away first segment, unpack individually
|
SimpleLogger().Write() << "parent of last node. " << forward_heap.GetData(current_node_id).parent;
|
||||||
|
|
||||||
std::reverse(packed_path.begin(), packed_path.end());
|
std::reverse(packed_path.begin(), packed_path.end());
|
||||||
packed_path.push_back(middle_node_id);
|
packed_path.push_back(middle_node_id);
|
||||||
current_node_id = middle_node_id;
|
current_node_id = middle_node_id;
|
||||||
@ -340,7 +368,7 @@ public:
|
|||||||
packed_path.push_back(current_node_id);
|
packed_path.push_back(current_node_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SimpleLogger().Write(logDEBUG) << "packed path";
|
||||||
BOOST_FOREACH(NodeID node, packed_path) {
|
BOOST_FOREACH(NodeID node, packed_path) {
|
||||||
SimpleLogger().Write(logDEBUG) << "node: " << node;
|
SimpleLogger().Write(logDEBUG) << "node: " << node;
|
||||||
}
|
}
|
||||||
|
@ -365,8 +365,8 @@ public:
|
|||||||
super::UnpackPath(
|
super::UnpackPath(
|
||||||
packed_legs1[i],
|
packed_legs1[i],
|
||||||
( at_beginning ? start_offset : 0),
|
( at_beginning ? start_offset : 0),
|
||||||
0,
|
|
||||||
false,
|
false,
|
||||||
|
SPECIAL_EDGEID, 0, false,
|
||||||
raw_route_data.unpacked_path_segments[i]
|
raw_route_data.unpacked_path_segments[i]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -478,9 +478,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void GetUncompressedGeometry(
|
virtual void GetUncompressedGeometry(
|
||||||
const unsigned id, std::vector<unsigned> & result_nodes
|
const unsigned node, std::vector<unsigned> & result_nodes
|
||||||
) const {
|
) const {
|
||||||
const NodeID node = m_via_node_list.at(id);
|
// const NodeID node = m_via_node_list.at(id);
|
||||||
// SimpleLogger().Write() << "translated " << id << " to " << node;
|
// SimpleLogger().Write() << "translated " << id << " to " << node;
|
||||||
// SimpleLogger().Write() << "getting geometry from compression bucket " << node << "/" << m_compressed_geometry_indices.size();
|
// SimpleLogger().Write() << "getting geometry from compression bucket " << node << "/" << m_compressed_geometry_indices.size();
|
||||||
unsigned begin = m_compressed_geometry_indices.at(node);
|
unsigned begin = m_compressed_geometry_indices.at(node);
|
||||||
|
Loading…
Reference in New Issue
Block a user