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

Method execute

kernels/RandomKernel.cpp:79–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77
78
79int RandomKernel::execute()
80{
81 Options readerOptions;
82
83 if (!m_bounds.empty())
84 readerOptions.add("bounds", m_bounds);
85
86 std::string distribution(Utils::tolower(m_distribution));
87 if (distribution == "uniform")
88 readerOptions.add("mode", "uniform");
89 else if (distribution == "normal")
90 readerOptions.add("mode", "normal");
91 else if (distribution == "random")
92 readerOptions.add("mode", "random");
93 else
94 throw pdal_error("invalid distribution: " + m_distribution);
95 readerOptions.add("count", m_numPointsToWrite);
96 Stage& reader = makeReader("", "readers.faux", readerOptions);
97
98 Options writerOptions;
99 if (m_bCompress)
100 writerOptions.add("compression", true);
101 Stage& writer = makeWriter(m_outputFile, reader, "", writerOptions);
102
103 ColumnPointTable table;
104 writer.prepare(table);
105 writer.execute(table);
106
107 return 0;
108}
109
110} // pdal

Callers

nothing calls this directly

Calls 4

tolowerFunction · 0.85
emptyMethod · 0.45
addMethod · 0.45
prepareMethod · 0.45

Tested by

no test coverage detected