Add VLRs forwarded from the input.
| 456 | |
| 457 | /// Add VLRs forwarded from the input. |
| 458 | void 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. |
nothing calls this directly
no test coverage detected