本文整理汇总了C++中LasWriter::getMetadata方法的典型用法代码示例。如果您正苦于以下问题:C++ LasWriter::getMetadata方法的具体用法?C++ LasWriter::getMetadata怎么用?C++ LasWriter::getMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LasWriter
的用法示例。
在下文中一共展示了LasWriter::getMetadata方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: metadataOp
TEST(LasWriterTest, metadata_options)
{
Options ops;
Option metadataOp("metadata", "");
Options metadataOps;
metadataOps.add("format", 4);
metadataOps.add("software_id", "MySoftwareId");
metadataOps.add("system_id", "FORWARD");
metadataOps.add("minor_version", "forward");
metadataOp.setOptions(metadataOps);
ops.add(metadataOp);
ops.add("filename", Support::temppath("wontgetwritten"));
LasWriter writer;
writer.setOptions(ops);
PointTable table;
writer.prepare(table);
MetadataNode m = writer.getMetadata();
m.add("minor_version", 56);
uint8_t format =
(uint8_t)LasTester::headerVal<unsigned>(writer, "format");
EXPECT_EQ(format, 4u);
std::string softwareId =
LasTester::headerVal<std::string>(writer, "software_id");
EXPECT_EQ(softwareId, "MySoftwareId");
std::string systemId =
LasTester::headerVal<std::string>(writer, "system_id");
// Since the option specifies forward and there is not associated
// metadata, the value should be the default.
LasHeader header;
EXPECT_EQ(systemId, header.getSystemIdentifier());
// In this case, we should have metadata to override the default.
uint8_t minorVersion =
(uint8_t)LasTester::headerVal<unsigned>(writer, "minor_version");
EXPECT_EQ(minorVersion, 56u);
}