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

Function GenerateTrafficKeysFromDataFile

generator/traffic_generator.cpp:22–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20namespace traffic
21{
22bool GenerateTrafficKeysFromDataFile(std::string const & mwmPath)
23{
24 try
25 {
26 std::vector<TrafficInfo::RoadSegmentId> keys;
27 TrafficInfo::ExtractTrafficKeys(mwmPath, keys);
28
29 std::vector<uint8_t> buf;
30 TrafficInfo::SerializeTrafficKeys(keys, buf);
31
32 FilesContainerW writeContainer(mwmPath, FileWriter::OP_WRITE_EXISTING);
33 auto writer = writeContainer.GetWriter(TRAFFIC_KEYS_FILE_TAG);
34 writer->Write(buf.data(), buf.size());
35 }
36 catch (RootException const & e)
37 {
38 LOG(LERROR, ("Failed to build traffic keys:", e.Msg()));
39 return false;
40 }
41
42 return true;
43}
44} // namespace traffic

Callers 1

generator_tool.cppFile · 0.85

Calls 4

GetWriterMethod · 0.80
WriteMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected