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

Function HierarchyEntryFromCsvRow

generator/hierarchy_entry.cpp:94–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94HierarchyEntry HierarchyEntryFromCsvRow(coding::CSVReader::Row const & row)
95{
96 CHECK_EQUAL(row.size(), 8, (row));
97
98 auto const & id = row[0];
99 auto const & parentId = row[1];
100 auto const & depth = row[2];
101 auto const & x = row[3];
102 auto const & y = row[4];
103 auto const & type = row[5];
104 auto const & name = row[6];
105 auto const & country = row[7];
106
107 HierarchyEntry entry;
108 entry.m_id = CompositeId(id);
109 if (!parentId.empty())
110 entry.m_parentId = CompositeId(parentId);
111
112 VERIFY(strings::to_size_t(depth, entry.m_depth), (row));
113 VERIFY(strings::to_double(x, entry.m_center.x), (row));
114 VERIFY(strings::to_double(y, entry.m_center.y), (row));
115 entry.m_type = classif().GetTypeByReadableObjectName(type);
116 entry.m_name = name;
117 entry.m_country = country;
118 return entry;
119}
120
121tree_node::types::Ptrs<HierarchyEntry> LoadHierachy(std::string const & filename)
122{

Callers 2

LoadHierachyFunction · 0.85
UNIT_CLASS_TESTFunction · 0.85

Calls 6

CompositeIdClass · 0.85
to_size_tFunction · 0.50
to_doubleFunction · 0.50
sizeMethod · 0.45
emptyMethod · 0.45

Tested by 1

UNIT_CLASS_TESTFunction · 0.68