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

Function DeserializeIndexGraph

libs/routing/index_graph_loader.cpp:277–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277void DeserializeIndexGraph(MwmValue const & mwmValue, VehicleType vehicleType, IndexGraph & graph)
278{
279 FilesContainerR::TReader reader(mwmValue.m_cont.GetReader(ROUTING_FILE_TAG));
280 ReaderSource<FilesContainerR::TReader> src(reader);
281
282 IndexGraphSerializer::Deserialize(graph, src, GetVehicleMask(vehicleType));
283
284 // Do not load restrictions (relation type = restriction) for pedestrian routing.
285 // https://wiki.openstreetmap.org/wiki/Relation:restriction
286 /// @todo OSM has 49 (April 2022) restriction:foot relations. We should use them someday,
287 /// starting from generator and saving like access, according to the vehicleType.
288 ASSERT(vehicleType != VehicleType::Transit, ());
289 if (vehicleType != VehicleType::Pedestrian)
290 {
291 RestrictionLoader restrictionLoader(mwmValue, graph);
292 if (restrictionLoader.HasRestrictions())
293 {
294 graph.SetRestrictions(restrictionLoader.StealRestrictions());
295 graph.SetUTurnRestrictions(restrictionLoader.StealNoUTurnRestrictions());
296 }
297 }
298
299 RoadAccess roadAccess;
300 if (ReadRoadAccessFromMwm(mwmValue, vehicleType, roadAccess))
301 graph.SetRoadAccess(std::move(roadAccess));
302
303 RoadPenalty roadPenalty;
304 if (ReadRoadPenaltyFromMwm(mwmValue, vehicleType, roadPenalty))
305 graph.SetRoadPenalty(std::move(roadPenalty));
306}
307
308uint32_t DeserializeIndexGraphNumRoads(MwmValue const & mwmValue, VehicleType vehicleType)
309{

Callers 4

TrackMatcherMethod · 0.85
FillWeightsFunction · 0.85
CreateIndexGraphFunction · 0.85
CreateIndexGraphMethod · 0.85

Calls 10

GetVehicleMaskFunction · 0.85
ASSERTFunction · 0.85
ReadRoadAccessFromMwmFunction · 0.85
ReadRoadPenaltyFromMwmFunction · 0.85
SetRoadAccessMethod · 0.80
SetRoadPenaltyMethod · 0.80
GetReaderMethod · 0.45
HasRestrictionsMethod · 0.45
SetRestrictionsMethod · 0.45
SetUTurnRestrictionsMethod · 0.45

Tested by

no test coverage detected