static
| 53 | |
| 54 | // static |
| 55 | bool 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 |