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

Method prepared

pdal/DbWriter.cpp:47–73  ·  view source on GitHub ↗

Build the list of dimensions for the output schema. Placing this here allows validation of dimensions before execution begins.

Source from the content-addressed store, hash-verified

45// Build the list of dimensions for the output schema.
46// Placing this here allows validation of dimensions before execution begins.
47void DbWriter::prepared(PointTableRef table)
48{
49 using namespace Dimension;
50
51 PointLayoutPtr layout = table.layout();
52
53 if (m_outputDims.empty())
54 {
55 for (auto& dimType : layout->dimTypes())
56 m_dbDims.push_back(XMLDim(dimType, layout->dimName(dimType.m_id)));
57 return;
58 }
59
60 DimTypeList dims;
61 for (std::string& s : m_outputDims)
62 {
63 DimType dt = layout->findDimType(s);
64 if (dt.m_id == Id::Unknown)
65 {
66 std::ostringstream oss;
67 oss << "Invalid dimension '" << s << "' specified for "
68 "'output_dims' option.";
69 throw pdal_error(oss.str());
70 }
71 m_dbDims.push_back(XMLDim(dt, layout->dimName(dt.m_id)));
72 }
73}
74
75
76void DbWriter::ready(PointTableRef /*table*/)

Callers 1

prepareMethod · 0.45

Calls 6

XMLDimClass · 0.85
dimNameMethod · 0.80
findDimTypeMethod · 0.80
strMethod · 0.80
emptyMethod · 0.45
dimTypesMethod · 0.45

Tested by

no test coverage detected