retrieve first and last nodes of a compressed segment
This commit is contained in:
parent
91ced39233
commit
577cf5ddc4
@ -225,3 +225,17 @@ GeometryCompressor::GetBucketReference(const EdgeID edge_id) const
|
|||||||
const unsigned index = m_edge_id_to_list_index_map.at(edge_id);
|
const unsigned index = m_edge_id_to_list_index_map.at(edge_id);
|
||||||
return m_compressed_geometries.at(index);
|
return m_compressed_geometries.at(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NodeID GeometryCompressor::GetFirstNodeIDOfBucket(const EdgeID edge_id) const
|
||||||
|
{
|
||||||
|
const auto &bucket = GetBucketReference(edge_id);
|
||||||
|
BOOST_ASSERT(bucket.size() >= 2);
|
||||||
|
return bucket[1].first;
|
||||||
|
}
|
||||||
|
NodeID GeometryCompressor::GetLastNodeIDOfBucket(const EdgeID edge_id) const
|
||||||
|
{
|
||||||
|
const auto &bucket = GetBucketReference(edge_id);
|
||||||
|
BOOST_ASSERT(bucket.size() >= 2);
|
||||||
|
return bucket[bucket.size()-2].first;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,8 @@ class GeometryCompressor
|
|||||||
unsigned GetPositionForID(const EdgeID edge_id) const;
|
unsigned GetPositionForID(const EdgeID edge_id) const;
|
||||||
const std::vector<GeometryCompressor::CompressedNode> &
|
const std::vector<GeometryCompressor::CompressedNode> &
|
||||||
GetBucketReference(const EdgeID edge_id) const;
|
GetBucketReference(const EdgeID edge_id) const;
|
||||||
|
NodeID GetFirstNodeIDOfBucket(const EdgeID edge_id) const;
|
||||||
|
NodeID GetLastNodeIDOfBucket(const EdgeID edge_id) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void IncreaseFreeList();
|
void IncreaseFreeList();
|
||||||
|
Loading…
Reference in New Issue
Block a user