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

Method handleForwardVlrs

io/CopcWriter.cpp:217–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217void CopcWriter::handleForwardVlrs(MetadataNode& forwards)
218{
219 if (!b->forwardVlrs)
220 return;
221
222 MetadataNodeList nodes = forwards.findChildren([](MetadataNode n)
223 { return Utils::startsWith(n.name(), "vlr_"); });
224 for (auto& n : nodes)
225 {
226 const MetadataNode& userIdNode = n.findChild("user_id");
227 const MetadataNode& recordIdNode = n.findChild("record_id");
228 if (userIdNode.valid() && recordIdNode.valid())
229 {
230
231 const MetadataNode& descriptionNode = n.findChild("description");
232 const std::vector<uint8_t>& data = Utils::base64_decode(n.findChild("data").value());
233 const char *d = (const char *)data.data();
234 std::vector<char> buf(d, d + data.size());
235 las::Evlr e(userIdNode.value(), (uint16_t)std::stoi(recordIdNode.value()),
236 descriptionNode.value(), std::move(buf));
237 b->vlrs.push_back(e);
238 }
239 }
240}
241
242void CopcWriter::prepared(PointTableRef table)
243{

Callers

nothing calls this directly

Calls 6

startsWithFunction · 0.85
nameMethod · 0.45
validMethod · 0.45
valueMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected