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

Method addForwardVlrs

io/LasWriter.cpp:458–479  ·  view source on GitHub ↗

Add VLRs forwarded from the input.

Source from the content-addressed store, hash-verified

456
457/// Add VLRs forwarded from the input.
458void LasWriter::addForwardVlrs()
459{
460 if (!d->forwardVlrs)
461 return;
462
463 auto pred = [](MetadataNode n)
464 { return Utils::startsWith(n.name(), "vlr_"); };
465
466 MetadataNodeList nodes = m_forwardMetadata.findChildren(pred);
467 for (auto& n : nodes)
468 {
469 const MetadataNode& userIdNode = n.findChild("user_id");
470 const MetadataNode& recordIdNode = n.findChild("record_id");
471 if (recordIdNode.valid() && userIdNode.valid())
472 {
473 const MetadataNode& dataNode = n.findChild("data");
474 uint16_t recordId = (uint16_t)std::stoi(recordIdNode.value());
475 addVlr(userIdNode.value(), recordId, n.description(),
476 Utils::base64_decode(dataNode.value()));
477 }
478 }
479}
480
481/// Set VLRs from the active spatial reference.
482/// \param srs - Active spatial reference.

Callers

nothing calls this directly

Calls 5

startsWithFunction · 0.85
nameMethod · 0.45
validMethod · 0.45
valueMethod · 0.45
descriptionMethod · 0.45

Tested by

no test coverage detected