本文整理汇总了C++中TextReader::setOptions方法的典型用法代码示例。如果您正苦于以下问题:C++ TextReader::setOptions方法的具体用法?C++ TextReader::setOptions怎么用?C++ TextReader::setOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextReader
的用法示例。
在下文中一共展示了TextReader::setOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compareTextLasStreaming
void compareTextLasStreaming(const std::string& textFilename,
const std::string& lasFilename)
{
std::string tempname(Support::temppath("testlas.las"));
FileUtils::deleteFile(tempname);
TextReader t;
Options to;
to.add("filename", textFilename);
t.setOptions(to);
LasWriter w;
Options wo;
wo.add("filename", tempname);
w.setInput(t);
w.setOptions(wo);
FixedPointTable in(1000);
w.prepare(in);
w.execute(in);
LasReader l1;
Options l1o;
l1o.add("filename", lasFilename);
l1.setOptions(l1o);
LasReader l2;
Options l2o;
l2o.add("filename", tempname);
l2.setOptions(l2o);
PointTable t1;
l1.prepare(t1);
PointViewSet s1 = l1.execute(t1);
EXPECT_EQ(s1.size(), 1U);
PointViewPtr v1 = *s1.begin();
PointTable t2;
l2.prepare(t2);
PointViewSet s2 = l2.execute(t2);
EXPECT_EQ(s2.size(), 1U);
PointViewPtr v2 = *s2.begin();
EXPECT_EQ(v1->size(), v2->size());
// Validate some point data.
for (PointId i = 0; i < v1->size(); ++i)
{
EXPECT_DOUBLE_EQ(v1->getFieldAs<double>(Dimension::Id::X, i),
v2->getFieldAs<double>(Dimension::Id::X, i));
EXPECT_DOUBLE_EQ(v1->getFieldAs<double>(Dimension::Id::Y, i),
v2->getFieldAs<double>(Dimension::Id::Y, i));
EXPECT_DOUBLE_EQ(v1->getFieldAs<double>(Dimension::Id::Z, i),
v2->getFieldAs<double>(Dimension::Id::Z, i));
}
}
示例2:
TEST(TextReaderTest, badheader)
{
TextReader t;
Options to;
to.add("filename", Support::datapath("text/badheader.txt"));
t.setOptions(to);
PointTable tt;
EXPECT_THROW(t.prepare(tt), pdal_error);
}
示例3:
// Make sure that dimension names containing digits works
TEST(RangeFilterTest, case_1659)
{
TextReader reader;
Options ops;
ops.add("filename", Support::datapath("text/numeric_dim.txt"));
reader.setOptions(ops);
Options rangeOps;
rangeOps.add("limits", "Eigenvalue0[:35]");
RangeFilter filter;
filter.setOptions(rangeOps);
filter.setInput(reader);
PointTable table;
filter.prepare(table);
PointViewSet viewSet = filter.execute(table);
PointViewPtr view = *viewSet.begin();
EXPECT_EQ(1u, viewSet.size());
EXPECT_EQ(3u, view->size());
}