| 91 | } |
| 92 | |
| 93 | void Framework::VisualizeCityBoundariesInRect(m2::RectD const & rect) |
| 94 | { |
| 95 | DataSource const & dataSource = GetDataSource(); |
| 96 | search::CitiesBoundariesTable table(dataSource); |
| 97 | table.Load(); |
| 98 | |
| 99 | std::vector<uint32_t> featureIds; |
| 100 | GetCityBoundariesInRectForTesting(table, rect, featureIds); |
| 101 | |
| 102 | FeaturesLoaderGuard loader(dataSource, dataSource.GetMwmIdByCountryFile(platform::CountryFile("World"))); |
| 103 | for (auto const fid : featureIds) |
| 104 | { |
| 105 | search::CitiesBoundariesTable::Boundaries boundaries; |
| 106 | if (!table.Get(fid, boundaries)) |
| 107 | continue; |
| 108 | |
| 109 | std::string id = "fid:" + strings::to_string(fid); |
| 110 | auto ft = loader.GetFeatureByIndex(fid); |
| 111 | if (ft) |
| 112 | { |
| 113 | auto name = ft->GetName(localisation::kEnglishLanguageIndex); |
| 114 | if (name.empty()) |
| 115 | name = ft->GetName(localisation::kDefaultNameIndex); |
| 116 | id.append(", name:").append(name); |
| 117 | } |
| 118 | |
| 119 | boundaries.ForEachBoundary([&id, this](indexer::CityBoundary const & cityBoundary, size_t i) |
| 120 | { |
| 121 | std::string idWithIndex = id; |
| 122 | if (i > 0) |
| 123 | idWithIndex = id + ", i:" + strings::to_string(i); |
| 124 | |
| 125 | DrawLine(cityBoundary.m_bbox, cityBoundaryBBColor, m_drapeApi, idWithIndex + ", bb"); |
| 126 | DrawLine(cityBoundary.m_cbox, cityBoundaryCBColor, m_drapeApi, idWithIndex + ", cb"); |
| 127 | DrawLine(cityBoundary.m_dbox, cityBoundaryDBColor, m_drapeApi, idWithIndex + ", db"); |
| 128 | }); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | void Framework::VisualizeCityRoadsInRect(m2::RectD const & rect) |
| 133 | { |
no test coverage detected