Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)

To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
This commit is contained in:
Konstantin Pastbin
2025-04-13 16:37:30 +07:00
commit e3e4a1985a
12931 changed files with 13195100 additions and 0 deletions

39
indexer/index_builder.cpp Normal file
View File

@@ -0,0 +1,39 @@
#include "indexer/index_builder.hpp"
#include "indexer/features_vector.hpp"
#include "base/logging.hpp"
#include "defines.hpp"
namespace indexer
{
bool BuildIndexFromDataFile(std::string const & dataFile, std::string const & tmpFile)
{
try
{
std::string const idxFileName(tmpFile + GEOM_INDEX_TMP_EXT);
{
FeaturesVectorTest features(dataFile);
FileWriter writer(idxFileName);
BuildIndex(features.GetHeader(), features.GetVector(), writer, tmpFile);
}
FilesContainerW(dataFile, FileWriter::OP_WRITE_EXISTING).Write(idxFileName, INDEX_FILE_TAG);
FileWriter::DeleteFileX(idxFileName);
}
catch (Reader::Exception const & e)
{
LOG(LERROR, ("Error while reading file: ", e.Msg()));
return false;
}
catch (Writer::Exception const & e)
{
LOG(LERROR, ("Error writing index file: ", e.Msg()));
return false;
}
return true;
}
} // namespace indexer