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

Method loadBpfDimensions

io/BpfWriter.cpp:206–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204
205
206void BpfWriter::loadBpfDimensions(PointLayoutPtr layout)
207{
208 Dimension::IdList dims;
209
210 if (m_outputDims.size())
211 {
212 for (std::string& s : m_outputDims)
213 {
214 Dimension::Id id = layout->findDim(s);
215 if (id == Dimension::Id::Unknown)
216 throwError("Invalid dimension '" + s + "' specified for "
217 "'output_dims' option.");
218 dims.push_back(id);
219 }
220 }
221 else
222 dims = layout->dims();
223
224 // Verify that we have X, Y and Z and that they're the first three
225 // dimensions.
226 std::sort(dims.begin(), dims.end());
227 if (dims.size() < 3 || dims[0] != Dimension::Id::X ||
228 dims[1] != Dimension::Id::Y || dims[2] != Dimension::Id::Z)
229 {
230 throwError("Missing one of dimensions X, Y or Z. Can't write BPF.");
231 }
232
233 for (auto id : dims)
234 {
235 BpfDimension dim;
236 dim.m_id = id;
237 dim.m_label = layout->dimName(id);
238 m_dims.push_back(dim);
239 }
240}
241
242
243void BpfWriter::prerunFile(const PointViewSet& pvSet)

Callers

nothing calls this directly

Calls 5

dimNameMethod · 0.80
sizeMethod · 0.45
findDimMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected