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

Method findVlrMetadata

io/LasWriter.cpp:396–420  ·  view source on GitHub ↗

Search for metadata associated with the provided recordId and userId. \param node - Top-level node to use for metadata search. \param recordId - Record ID to match. \param userId - User ID to match.

Source from the content-addressed store, hash-verified

394/// \param recordId - Record ID to match.
395/// \param userId - User ID to match.
396MetadataNode LasWriter::findVlrMetadata(MetadataNode node,
397 uint16_t recordId, const std::string& userId)
398{
399 std::string sRecordId = std::to_string(recordId);
400
401 // Find a node whose name starts with vlr and that has child nodes
402 // with the name and recordId we're looking for.
403 auto pred = [sRecordId,userId](MetadataNode n)
404 {
405 auto recPred = [sRecordId](MetadataNode n)
406 {
407 return n.name() == "record_id" &&
408 n.value() == sRecordId;
409 };
410 auto userPred = [userId](MetadataNode n)
411 {
412 return n.name() == "user_id" &&
413 n.value() == userId;
414 };
415 return (Utils::startsWith(n.name(), "vlr") &&
416 !n.findChild(recPred).empty() &&
417 !n.findChild(userPred).empty());
418 };
419 return node.find(pred);
420}
421
422
423void LasWriter::addMetadataVlr(MetadataNode& forward)

Callers

nothing calls this directly

Calls 5

startsWithFunction · 0.85
nameMethod · 0.45
valueMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected