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

Function CheckCoverage

generator/srtm_coverage_checker/srtm_coverage_checker.cpp:107–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void CheckCoverage(SafeTileManager & manager)
108{
109 ForEachMWM(manager, [&](platform::LocalCountryFile const & file)
110 {
111 size_t all = 0;
112 size_t good = 0;
113 feature::ForEachFeature(file.GetPath(MapFileType::Map), [&](FeatureType & ft, uint32_t)
114 {
115 if (!manager.IsAltitudeRoad(ft))
116 return;
117
118 ft.ParseGeometry(FeatureType::BEST_GEOMETRY);
119 all += ft.GetPointsCount();
120
121 for (size_t i = 0; i < ft.GetPointsCount(); ++i)
122 {
123 auto const height = manager.GetAltitude(mercator::ToLatLon(ft.GetPoint(i)));
124 if (height != geometry::kInvalidAltitude)
125 good++;
126 }
127 });
128
129 auto const bad = all - good;
130 auto const percent = (all == 0) ? 0.0 : bad * 100.0 / all;
131 LOG_SHORT(LINFO, (percent > 10.0 ? "Huge" : "Low", "error rate in:", file.GetCountryName(), "good:", good,
132 "bad:", bad, "all:", all, "%:", percent));
133 });
134}
135
136void CheckDistance(SafeTileManager & manager)
137{

Callers 1

mainFunction · 0.85

Calls 10

ForEachMWMFunction · 0.85
ForEachFeatureFunction · 0.85
IsAltitudeRoadMethod · 0.80
ParseGeometryMethod · 0.80
ToLatLonFunction · 0.50
GetPathMethod · 0.45
GetPointsCountMethod · 0.45
GetAltitudeMethod · 0.45
GetPointMethod · 0.45
GetCountryNameMethod · 0.45

Tested by

no test coverage detected