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

Method VisualizeCityBoundariesInRect

libs/map/framework_visualize.cpp:93–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void 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
132void Framework::VisualizeCityRoadsInRect(m2::RectD const & rect)
133{

Callers 1

ProcessSelectionModeMethod · 0.80

Calls 12

to_stringFunction · 0.85
DrawLineFunction · 0.85
GetMwmIdByCountryFileMethod · 0.80
ForEachBoundaryMethod · 0.80
CountryFileClass · 0.50
LoadMethod · 0.45
GetMethod · 0.45
GetFeatureByIndexMethod · 0.45
GetNameMethod · 0.45
emptyMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected