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

Method FillCameraInWays

generator/collector_camera.cpp:98–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void CameraCollector::FillCameraInWays()
99{
100 for (uint64_t id : m_roadOsmIDs)
101 {
102 WayElement way(id);
103 CHECK(m_cache->GetWay(id, way), ());
104
105 for (auto const & node : way.m_nodes)
106 {
107 auto it = m_speedCameras.find(node);
108 if (it != m_speedCameras.cend())
109 it->second.m_ways.push_back(id);
110 }
111 }
112
113 size_t detachedCameras = 0;
114 ForEachCamera([&detachedCameras](auto & c)
115 {
116 if (c.m_ways.empty())
117 ++detachedCameras;
118 else
119 base::SortUnique(c.m_ways);
120 });
121
122 LOG(LINFO, ("Total cameras count:", m_speedCameras.size(), "Detached cameras count:", detachedCameras));
123}
124
125void CameraCollector::MergeInto(CameraCollector & collector) const
126{

Callers

nothing calls this directly

Calls 7

SortUniqueFunction · 0.85
GetWayMethod · 0.45
findMethod · 0.45
cendMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected