| 250 | } |
| 251 | |
| 252 | void 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 | |
| 279 | IRoadGraph::RoadInfo const & FeaturesRoadGraphBase::GetCachedRoadInfo(FeatureID const & featureId, |
| 280 | SpeedParams const & speedParams) const |
nothing calls this directly
no test coverage detected