Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2011-10-12 16:54:30 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:25:53 +0300
commiteddeb5176f2ff707ced4cea336b29a49bc319be5 (patch)
treea5e00541190a0cc0b517b857bf8aa55aef51b88a /indexer/scale_index_builder.hpp
parentc8325d4b968c95ae75f160f7b294903667bd5cd8 (diff)
Prepare for drawing WorldCoasts in [0-17] scales:
- Use DataHeader::GetLastScale for covering depth calculation - Pass correct scale to ForEachInIntervalAndScale for scale >= 10.
Diffstat (limited to 'indexer/scale_index_builder.hpp')
-rw-r--r--indexer/scale_index_builder.hpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/indexer/scale_index_builder.hpp b/indexer/scale_index_builder.hpp
index a28530d959..dc0b708f6e 100644
--- a/indexer/scale_index_builder.hpp
+++ b/indexer/scale_index_builder.hpp
@@ -56,11 +56,11 @@ class FeatureCoverer
public:
FeatureCoverer(uint32_t bucket,
- pair<int, int> const & scaleRange,
+ int codingScale,
SorterT & sorter,
uint32_t & numFeatures)
: m_Sorter(sorter),
- m_mwmScaleRange(scaleRange),
+ m_codingDepth(covering::GetCodingDepth(codingScale)),
m_ScaleRange(ScaleIndexBase::ScaleRangeForBucket(bucket)),
m_NumFeatures(numFeatures)
{
@@ -71,8 +71,7 @@ public:
{
if (FeatureShouldBeIndexed(f))
{
- vector<int64_t> const cells = covering::CoverFeature(f,
- covering::GetCodingDepth(m_mwmScaleRange), 250);
+ vector<int64_t> const cells = covering::CoverFeature(f, m_codingDepth, 250);
for (vector<int64_t>::const_iterator it = cells.begin(); it != cells.end(); ++it)
m_Sorter.Add(CellFeaturePair(*it, offset));
@@ -93,7 +92,7 @@ public:
private:
SorterT & m_Sorter;
- pair<int, int> m_mwmScaleRange;
+ int m_codingDepth;
pair<uint32_t, uint32_t> m_ScaleRange;
uint32_t & m_NumFeatures;
};
@@ -117,7 +116,7 @@ private:
template <class FeaturesVectorT, class WriterT>
inline void IndexScales(uint32_t bucketsCount,
- pair<int, int> const & scaleRange,
+ int codingScale,
FeaturesVectorT const & featuresVector,
WriterT & writer,
string const & tmpFilePrefix)
@@ -139,7 +138,7 @@ inline void IndexScales(uint32_t bucketsCount,
WriterFunctor<FileWriter> out(cellsToFeaturesWriter);
SorterType sorter(1024*1024, tmpFilePrefix + ".c2f.tmp", out);
featuresVector.ForEachOffset(
- FeatureCoverer<SorterType>(bucket, scaleRange, sorter, numFeatures));
+ FeatureCoverer<SorterType>(bucket, codingScale, sorter, numFeatures));
// LOG(LINFO, ("Sorting..."));
sorter.SortAndFinish();
}