| 92 | } |
| 93 | |
| 94 | HierarchyEntry 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 | |
| 121 | tree_node::types::Ptrs<HierarchyEntry> LoadHierachy(std::string const & filename) |
| 122 | { |