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

Function BuildRoutingIndex

generator/routing_index_generator.cpp:599–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597}
598
599bool BuildRoutingIndex(string const & filename, string const & country,
600 CountryParentNameGetterFn const & countryParentNameGetterFn)
601{
602 LOG(LINFO, ("Building routing index for", filename));
603 try
604 {
605 Processor processor(country, countryParentNameGetterFn);
606 processor.ProcessAllFeatures(filename);
607
608 IndexGraph graph;
609 processor.BuildGraph(graph);
610
611 FilesContainerW cont(filename, FileWriter::OP_WRITE_EXISTING);
612 auto writer = cont.GetWriter(ROUTING_FILE_TAG);
613
614 auto const startPos = writer->Pos();
615 IndexGraphSerializer::Serialize(graph, processor.GetMasks(), *writer);
616 auto const sectionSize = writer->Pos() - startPos;
617
618 LOG(LINFO, ("Routing section created:", sectionSize, "bytes,", graph.GetNumRoads(), "roads,", graph.GetNumJoints(),
619 "joints,", graph.GetNumPoints(), "points"));
620 return true;
621 }
622 catch (RootException const & e)
623 {
624 LOG(LERROR, ("An exception happened while creating", ROUTING_FILE_TAG, "section:", e.what()));
625 return false;
626 }
627}
628
629/// \brief Serializes all the cross mwm information to |sectionName| of |mwmFile| including:
630/// * header

Callers 3

TestMaxspeedsSectionFunction · 0.85
generator_tool.cppFile · 0.85
BuildRoutingMethod · 0.85

Calls 9

SerializeFunction · 0.85
ProcessAllFeaturesMethod · 0.80
BuildGraphMethod · 0.80
GetWriterMethod · 0.80
PosMethod · 0.45
GetNumRoadsMethod · 0.45
GetNumJointsMethod · 0.45
GetNumPointsMethod · 0.45
whatMethod · 0.45

Tested by 2

TestMaxspeedsSectionFunction · 0.68
BuildRoutingMethod · 0.68