MCPcopy Create free account
hub / github.com/comaps/comaps / WriteBlock

Method WriteBlock

libs/indexer/centers_table.cpp:122–134  ·  view source on GitHub ↗

Each center is encoded as delta from some prediction. For the first center in the block map base point is used as a prediction, for all other centers in the block previous center is used as a prediction.

Source from the content-addressed store, hash-verified

120// For the first center in the block map base point is used as a prediction, for all other
121// centers in the block previous center is used as a prediction.
122void CentersTableBuilder::WriteBlock(Writer & w, std::vector<m2::PointU>::const_iterator begin,
123 std::vector<m2::PointU>::const_iterator end) const
124{
125 uint64_t delta = coding::EncodePointDeltaAsUint(*begin, m_codingParams.GetBasePoint());
126 WriteVarUint(w, delta);
127 auto prevIt = begin;
128 for (auto it = begin + 1; it != end; ++it)
129 {
130 delta = coding::EncodePointDeltaAsUint(*it, *prevIt);
131 WriteVarUint(w, delta);
132 prevIt = it;
133 }
134}
135
136void CentersTableBuilder::Freeze(Writer & writer) const
137{

Callers

nothing calls this directly

Calls 3

EncodePointDeltaAsUintFunction · 0.85
WriteVarUintFunction · 0.85
GetBasePointMethod · 0.45

Tested by

no test coverage detected