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

Method ExtractRoadInfo

libs/routing/features_road_graph.cpp:252–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void FeaturesRoadGraphBase::ExtractRoadInfo(FeatureID const & featureId, FeatureType & ft, double speedKMpH,
253 RoadInfo & ri) const
254{
255 ri.m_speedKMPH = speedKMpH;
256 ri.m_bidirectional = !IsOneWay(ft);
257
258 ft.ParseGeometry(FeatureType::BEST_GEOMETRY);
259 size_t const pointsCount = ft.GetPointsCount();
260
261 geometry::Altitudes altitudes;
262 auto const loader = GetAltitudesLoader(featureId.m_mwmId);
263 if (loader)
264 altitudes = loader->GetAltitudes(featureId.m_index, pointsCount);
265 else
266 altitudes = geometry::Altitudes(pointsCount, geometry::kDefaultAltitudeMeters);
267
268 CHECK_EQUAL(altitudes.size(), pointsCount, ("GetAltitudes for", featureId, "returns wrong altitudes:", altitudes));
269
270 ri.m_junctions.resize(pointsCount);
271 for (size_t i = 0; i < pointsCount; ++i)
272 {
273 auto & pt = ri.m_junctions[i];
274 pt.SetPoint(ft.GetPoint(i));
275 pt.SetAltitude(altitudes[i]);
276 }
277}
278
279IRoadGraph::RoadInfo const & FeaturesRoadGraphBase::GetCachedRoadInfo(FeatureID const & featureId,
280 SpeedParams const & speedParams) const

Callers

nothing calls this directly

Calls 9

AltitudesClass · 0.85
ParseGeometryMethod · 0.80
GetPointsCountMethod · 0.45
GetAltitudesMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
SetPointMethod · 0.45
GetPointMethod · 0.45
SetAltitudeMethod · 0.45

Tested by

no test coverage detected