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

Function TEST

test/unit/filters/NeighborClassifierFilterTest.cpp:65–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65TEST(NeighborClassifierFilterTest, singleRange)
66{
67 Options ro;
68 ro.add("filename", Support::datapath("las/sample_c.las"));
69
70 StageFactory factory;
71 Stage& r = *(factory.createStage("readers.las"));
72 r.setOptions(ro);
73 point_count_t count = 0;
74 stats::Summary::EnumMap OrigClassifications = GetClassifications(r, &count);
75
76 std::vector<unsigned int> kvals = {1, 3};
77 for (auto &k : kvals) {
78
79 Options fo;
80 fo.add("domain", "Classification[14:14]");
81 //fo.add("dimension", "Classification");
82 fo.add("k", k);
83
84 Stage& f = *(factory.createStage("filters.neighborclassifier"));
85 f.setInput(r);
86
87 f.setOptions(fo);
88
89 PointTable table;
90 f.prepare(table);
91 PointViewSet viewSet = f.execute(table);
92 PointViewPtr view = *viewSet.begin();
93
94 EXPECT_EQ(1u, viewSet.size());
95 EXPECT_EQ(count, view->size());
96
97 stats::Summary::EnumMap NewClassifications = GetClassifications(f);
98
99 for (auto& p : OrigClassifications)
100 {
101 if (k == 1)
102 {
103 EXPECT_TRUE(NewClassifications[p.first] == OrigClassifications[p.first]);
104 }
105 else
106 {
107 if (p.first == 14)
108 {
109 EXPECT_TRUE(NewClassifications[p.first] == 0);
110 }
111 else
112 EXPECT_TRUE(NewClassifications[p.first] >= OrigClassifications[p.first]);
113 }
114 }
115 }
116}
117
118TEST(NeighborClassifierFilterTest, multipleRange)
119{

Callers

nothing calls this directly

Calls 9

datapathFunction · 0.85
GetClassificationsFunction · 0.85
createStageMethod · 0.80
setOptionsMethod · 0.80
addMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected