| 75 | } |
| 76 | |
| 77 | bool BuildWorldRoads(std::string const & mwmFilePath, std::string const & roadsFilePath) |
| 78 | { |
| 79 | CrossBorderGraph graph; |
| 80 | |
| 81 | bool const filledGraph = FillRoadsFromFile(graph, roadsFilePath); |
| 82 | if (!filledGraph) |
| 83 | { |
| 84 | LOG(LERROR, ("Could not fill CrossBorderGraph from", roadsFilePath)); |
| 85 | return false; |
| 86 | } |
| 87 | |
| 88 | CHECK(!graph.m_segments.empty(), ("Road segments for CrossBorderGraph should be set.", roadsFilePath)); |
| 89 | |
| 90 | FilesContainerW cont(mwmFilePath, FileWriter::OP_WRITE_EXISTING); |
| 91 | auto writer = cont.GetWriter(ROUTING_WORLD_FILE_TAG); |
| 92 | |
| 93 | /// @todo Default ctor loads countries.txt from data folder. |
| 94 | /// But this is a "previous build" countries list! |
| 95 | storage::Storage storage; |
| 96 | std::shared_ptr<NumMwmIds> numMwmIds = CreateNumMwmIds(storage); |
| 97 | |
| 98 | CrossBorderGraphSerializer::Serialize(graph, writer, numMwmIds); |
| 99 | LOG(LINFO, ("Serialized", graph.m_segments.size(), "roads for", graph.m_mwms.size(), "regions.")); |
| 100 | |
| 101 | return true; |
| 102 | } |
| 103 | } // namespace routing |
no test coverage detected