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

Function ParseFeatureIdToTestIdMapping

generator/utils.cpp:111–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111bool ParseFeatureIdToTestIdMapping(std::string const & path, ankerl::unordered_dense::map<uint32_t, uint64_t> & mapping)
112{
113 bool success = true;
114 feature::ForEachFeature(path, [&](FeatureType & feature, uint32_t fid)
115 {
116 auto const testIdStr = feature.GetMetadata(feature::Metadata::FMD_TEST_ID);
117 uint64_t testId;
118 if (!strings::to_uint(testIdStr, testId))
119 {
120 LOG(LERROR, ("Can't parse test id from:", testIdStr, "for the feature", fid));
121 success = false;
122 return;
123 }
124 mapping.emplace(fid, testId);
125 });
126 return success;
127}
128
129search::CBV GetLocalities(std::string const & dataPath)
130{

Callers 3

BuildCitiesIdsForTestingFunction · 0.85
UNIT_CLASS_TESTFunction · 0.85

Calls 4

ForEachFeatureFunction · 0.85
to_uintFunction · 0.85
GetMetadataMethod · 0.45
emplaceMethod · 0.45

Tested by 1

UNIT_CLASS_TESTFunction · 0.68