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

Method GetSpeedCameraInfo

libs/routing/index_graph_loader.cpp:124–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124vector<RouteSegment::SpeedCamera> IndexGraphLoaderImpl::GetSpeedCameraInfo(Segment const & segment)
125{
126 SpeedCamerasMapT const & camerasMap = ReceiveSpeedCamsFromMwm(segment.GetMwmId());
127 auto it = camerasMap.find({segment.GetFeatureId(), segment.GetSegmentIdx()});
128 if (it == camerasMap.end())
129 return {};
130
131 auto cameras = it->second;
132 base::SortUnique(cameras, std::less<RouteSegment::SpeedCamera>(),
133 [](auto const & l, auto const & r) { return l.EqualCoef(r); });
134
135 // Cameras stored from beginning to ending of segment. So if we go at segment in backward direction,
136 // we should read cameras in reverse sequence too.
137 if (!segment.IsForward())
138 std::reverse(cameras.begin(), cameras.end());
139
140 return cameras;
141}
142
143IndexGraphLoaderImpl::GraphPtrT IndexGraphLoaderImpl::CreateIndexGraph(NumMwmId numMwmId, GeometryPtrT & geometry)
144{

Callers 1

GetSpeedCamInfoMethod · 0.45

Calls 9

SortUniqueFunction · 0.85
EqualCoefMethod · 0.80
GetMwmIdMethod · 0.45
findMethod · 0.45
GetFeatureIdMethod · 0.45
GetSegmentIdxMethod · 0.45
endMethod · 0.45
IsForwardMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected