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

Method SplitIntoMwms

tools/track_analyzing/log_parser.cpp:157–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void LogParser::SplitIntoMwms(UserToTrack const & userToTrack, MwmToTracks & mwmToTracks) const
158{
159 base::Timer timer;
160
161 PointToMwmId const pointToMwmId(m_mwmTree, *m_numMwmIds, m_dataDir);
162
163 for (auto const & kv : userToTrack)
164 {
165 string const & user = kv.first;
166 Track const & track = kv.second;
167
168 routing::NumMwmId mwmId = routing::kFakeNumMwmId;
169 for (DataPoint const & point : track)
170 {
171 mwmId = pointToMwmId.FindMwmId(mercator::FromLatLon(point.m_latLon), mwmId);
172 if (mwmId != routing::kFakeNumMwmId)
173 mwmToTracks[mwmId][user].push_back(point);
174 else
175 LOG(LERROR, ("Can't match mwm region for", point.m_latLon, ", user:", user));
176 }
177 }
178
179 LOG(LINFO, ("Data was split into", mwmToTracks.size(), "mwms, elapsed:", timer.ElapsedSeconds(), "seconds"));
180}
181} // namespace track_analyzing

Callers

nothing calls this directly

Calls 5

FindMwmIdMethod · 0.80
ElapsedSecondsMethod · 0.80
FromLatLonFunction · 0.50
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected