MCPcopy Create free account
hub / github.com/PDAL/PDAL / write

Method write

io/EptAddonWriter.cpp:80–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78};
79
80void EptAddonWriter::HierarchyWriter::write(const std::string& hierarchyDir, NL::json& curr,
81 const ept::Key& key) const
82{
83 auto it = m_hierarchy.find(key);
84 if (it == m_hierarchy.end())
85 return;
86
87 const ept::Overlap& overlap = *it;
88 if (!overlap.m_count)
89 return;
90
91 const std::string keyName = key.toString();
92 if (m_step && key.d && (key.d % m_step == 0))
93 {
94 curr[keyName] = -1;
95
96 // Create a new hierarchy subtree.
97 NL::json next {{ keyName, overlap.m_count }};
98
99 for (uint64_t dir(0); dir < 8; ++dir)
100 write(hierarchyDir, next, key.bisect(dir));
101
102 std::string filename = hierarchyDir + keyName + ".json";
103 std::string data = next.dump();
104 m_pool.add([this, filename, data]()
105 {
106 m_connector.put(filename, data);
107 });
108 }
109 else
110 {
111 curr[keyName] = overlap.m_count;
112 for (uint64_t dir(0); dir < 8; ++dir)
113 write(hierarchyDir, curr, key.bisect(dir));
114 }
115}
116
117CREATE_STATIC_STAGE(EptAddonWriter, s_info)
118

Callers 1

writeOneMethod · 0.45

Calls 11

writeFunction · 0.50
logFunction · 0.50
findMethod · 0.45
endMethod · 0.45
toStringMethod · 0.45
dumpMethod · 0.45
addMethod · 0.45
putMethod · 0.45
getMethod · 0.45
nameMethod · 0.45
filenameMethod · 0.45

Tested by

no test coverage detected