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

Function ReadFeatures

generator/check_model.cpp:17–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15using namespace feature;
16
17void ReadFeatures(std::string const & fName)
18{
19 Classificator const & c = classif();
20
21 FeaturesVectorTest(fName).GetVector().ForEach([&](FeatureType & ft, uint32_t)
22 {
23 TypesHolder types(ft);
24
25 std::vector<uint32_t> vTypes;
26 for (uint32_t t : types)
27 {
28 CHECK_EQUAL(c.GetTypeForIndex(c.GetIndexForType(t)), t, ());
29 vTypes.push_back(t);
30 }
31
32 sort(vTypes.begin(), vTypes.end());
33 CHECK(unique(vTypes.begin(), vTypes.end()) == vTypes.end(), ());
34
35 m2::RectD const r = ft.GetLimitRect(FeatureType::BEST_GEOMETRY);
36 CHECK(r.IsValid(), ());
37
38 GeomType const type = ft.GetGeomType();
39 if (type == GeomType::Line)
40 CHECK_GREATER(ft.GetPointsCount(), 1, ());
41
42 CHECK(CanGenerateLike(vTypes, ft.GetGeomType()), ());
43 });
44
45 LOG(LINFO, ("OK"));
46}
47} // namespace check_model

Callers 2

generator_tool.cppFile · 0.85
ReadFeatureMethod · 0.85

Calls 13

FeaturesVectorTestClass · 0.85
uniqueFunction · 0.85
CanGenerateLikeFunction · 0.85
ForEachMethod · 0.45
GetTypeForIndexMethod · 0.45
GetIndexForTypeMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetLimitRectMethod · 0.45
IsValidMethod · 0.45
GetGeomTypeMethod · 0.45

Tested by

no test coverage detected