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

Function FillRoadsFromFile

generator/routing_world_roads_generator.cpp:55–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55bool FillRoadsFromFile(CrossBorderGraph & graph, std::string const & roadsFilePath)
56{
57 try
58 {
59 auto reader = coding::CSVReader(roadsFilePath, false /* hasHeader */, ' ' /* delimiter */);
60
61 reader.ForEachRow([&](auto const & row)
62 {
63 auto const & [segId, seg] = ReadSegment(row);
64 graph.AddCrossBorderSegment(segId, seg);
65 });
66
67 return true;
68 }
69 catch (std::exception const & e)
70 {
71 LOG(LERROR, ("Exception while filling graph", e.what()));
72 }
73
74 return false;
75}
76
77bool BuildWorldRoads(std::string const & mwmFilePath, std::string const & roadsFilePath)
78{

Callers 1

BuildWorldRoadsFunction · 0.85

Calls 5

CSVReaderClass · 0.85
ReadSegmentFunction · 0.85
ForEachRowMethod · 0.80
AddCrossBorderSegmentMethod · 0.80
whatMethod · 0.45

Tested by

no test coverage detected