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

Method FindRoads

libs/routing/features_road_graph.cpp:172–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172vector<IRoadGraph::FullRoadInfo> FeaturesRoadGraphBase::FindRoads(m2::RectD const & rect,
173 IsGoodFeatureFn const & isGoodFeature) const
174{
175 vector<IRoadGraph::FullRoadInfo> roads;
176
177 m_dataSource.ForEachStreet([&](FeatureType & ft)
178 {
179 if (!m_vehicleModel.IsRoad(ft))
180 return;
181
182 FeatureID const & featureId = ft.GetID();
183 if (isGoodFeature && !isGoodFeature(featureId))
184 return;
185
186 // DataSource::ForEachInRect() gives not only features inside |rect| but some other features
187 // which lie close to the rect. Removes all the features which don't cross |rect|.
188 auto const & roadInfo = GetCachedRoadInfo(featureId, ft, kInvalidSpeedKMPH);
189 if (!RectCoversPolyline(roadInfo.m_junctions, rect))
190 return;
191
192 roads.emplace_back(featureId, roadInfo);
193 }, rect);
194
195 return roads;
196}
197
198void FeaturesRoadGraphBase::GetFeatureTypes(FeatureID const & featureId, feature::TypesHolder & types) const
199{

Callers 2

FillDeadEndsCacheMethod · 0.45
FindBestEdgesMethod · 0.45

Calls 5

RectCoversPolylineFunction · 0.85
ForEachStreetMethod · 0.80
IsRoadMethod · 0.45
GetIDMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected