本文整理汇总了C++中PointLayoutPtr::findDimType方法的典型用法代码示例。如果您正苦于以下问题:C++ PointLayoutPtr::findDimType方法的具体用法?C++ PointLayoutPtr::findDimType怎么用?C++ PointLayoutPtr::findDimType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointLayoutPtr
的用法示例。
在下文中一共展示了PointLayoutPtr::findDimType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepared
// Build the list of dimensions for the output schema.
// Placing this here allows validation of dimensions before execution begins.
void DbWriter::prepared(PointTableRef table)
{
using namespace Dimension;
PointLayoutPtr layout = table.layout();
if (m_outputDims.empty())
{
for (auto& dimType : layout->dimTypes())
m_dbDims.push_back(XMLDim(dimType, layout->dimName(dimType.m_id)));
return;
}
DimTypeList dims;
for (std::string& s : m_outputDims)
{
DimType dt = layout->findDimType(s);
if (dt.m_id == Id::Unknown)
{
std::ostringstream oss;
oss << "Invalid dimension '" << s << "' specified for "
"'output_dims' option.";
throw pdal_error(oss.str());
}
m_dbDims.push_back(XMLDim(dt, layout->dimName(dt.m_id)));
}
}
示例2: dimTypes
DimTypeList DbWriter::dimTypes(PointTableRef table)
{
using namespace Dimension;
PointLayoutPtr layout = table.layout();
if (m_outputDims.empty())
return layout->dimTypes();
DimTypeList dims;
for (std::string& s : m_outputDims)
{
DimType dt = layout->findDimType(s);
if (dt.m_id == Id::Unknown)
{
std::ostringstream oss;
oss << "Invalid dimension '" << s << "' specified for "
"'output_dims' option.";
throw pdal_error(oss.str());
}
dims.push_back(dt);
}
return dims;
}