[generator] Move ParseFeatureIdToOsmIdMapping from cities_boundaries_builder.cpp to generator/utils

This commit is contained in:
tatiana-yan 2019-04-11 13:35:06 +03:00 committed by Maksim Andrianov
parent 0f21778cf3
commit 195e8a084b
3 changed files with 14 additions and 9 deletions

View file

@ -39,15 +39,6 @@ namespace generator
{
namespace
{
bool ParseFeatureIdToOsmIdMapping(string const & path,
map<uint32_t, vector<base::GeoObjectId>> & mapping)
{
return ForEachOsmId2FeatureId(path,
[&](base::GeoObjectId const & osmId, uint32_t const featureId) {
mapping[featureId].push_back(osmId);
});
}
bool ParseFeatureIdToTestIdMapping(string const & path, map<uint32_t, vector<uint64_t>> & mapping)
{
bool success = true;

View file

@ -44,4 +44,13 @@ void LoadDataSource(DataSource & dataSource)
}
}
}
bool ParseFeatureIdToOsmIdMapping(std::string const & path,
std::map<uint32_t, std::vector<base::GeoObjectId>> & mapping)
{
return ForEachOsmId2FeatureId(path,
[&](base::GeoObjectId const & osmId, uint32_t const featureId) {
mapping[featureId].push_back(osmId);
});
}
} // namespace generator

View file

@ -15,7 +15,9 @@
#include "base/logging.hpp"
#include <cstdint>
#include <map>
#include <string>
#include <vector>
namespace generator
{
@ -60,4 +62,7 @@ bool ForEachOsmId2FeatureId(std::string const & path, ToDo && toDo)
return true;
}
bool ParseFeatureIdToOsmIdMapping(std::string const & path,
std::map<uint32_t, std::vector<base::GeoObjectId>> & mapping);
} // namespace generator