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

Method IsPopularAttraction

generator/filter_world.cpp:55–76  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

53
54// static
55bool FilterWorld::IsPopularAttraction(feature::FeatureBuilder const & fb, std::string const & popularityFilename)
56{
57 if (fb.GetName().empty())
58 return false;
59
60 auto const & isPartOfTourismAttractions = ftypes::IsPartOfTourismAttractionsChecker::Instance();
61 if (!isPartOfTourismAttractions(fb.GetTypes()))
62 return false;
63
64 if (popularityFilename.empty())
65 return false;
66
67 auto static const & m_popularPlaces = GetOrLoadPopularPlaces(popularityFilename);
68 auto const it = m_popularPlaces.find(fb.GetMostGenericOsmId());
69 if (it == m_popularPlaces.end())
70 return false;
71
72 // todo(@t.yan): adjust
73 uint8_t const kPopularityThreshold = 13;
74 // todo(@t.yan): maybe check place has wikipedia link.
75 return it->second >= kPopularityThreshold;
76}
77} // namespace generator

Callers

nothing calls this directly

Calls 6

GetMostGenericOsmIdMethod · 0.80
emptyMethod · 0.45
GetNameMethod · 0.45
GetTypesMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected