本文整理汇总了C++中PointLayoutPtr类的典型用法代码示例。如果您正苦于以下问题:C++ PointLayoutPtr类的具体用法?C++ PointLayoutPtr怎么用?C++ PointLayoutPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PointLayoutPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addDimensions
void TIndexReader::addDimensions(PointLayoutPtr layout)
{
using namespace pdal::Dimension::Type;
layout->registerDim(pdal::Dimension::Id::X);
layout->registerDim(pdal::Dimension::Id::Y);
layout->registerDim(pdal::Dimension::Id::Z);
}
示例2: 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)));
}
}
示例3: registerDim
// Try to map dimension names to existing PDAL dimension names by
// checking them with certain characters removed.
Dimension::Id NumpyReader::registerDim(PointLayoutPtr layout,
const std::string& name, Dimension::Type pdalType)
{
Dimension::Id id;
auto registerName = [&layout, &pdalType, &id](std::string name, char elim)
{
if (elim != '\0')
Utils::remove(name, elim);
Dimension::Id tempId = Dimension::id(name);
if (tempId != Dimension::Id::Unknown)
{
id = tempId;
layout->registerDim(id, pdalType);
return true;
}
return false;
};
// Try registering the name in various ways. If that doesn't work,
// just punt and use the name as is.
if (!registerName(name, '\0') && !registerName(name, '-') &&
!registerName(name, ' ') && !registerName(name, '_'))
id = layout->registerOrAssignDim(name, pdalType);
return id;
}
示例4: TEST
TEST(KDIndex, neighbordims)
{
PointTable table;
PointLayoutPtr layout = table.layout();
PointView view(table);
layout->registerDim(Dimension::Id::X);
layout->registerDim(Dimension::Id::Z);
view.setField(Dimension::Id::X, 0, 0);
view.setField(Dimension::Id::Z, 0, 0);
view.setField(Dimension::Id::X, 1, 1);
view.setField(Dimension::Id::Z, 1, 1);
EXPECT_THROW(KD2Index index(view), pdal_error);
PointTable table2;
PointLayoutPtr layout2 = table.layout();
PointView view2(table2);
layout->registerDim(Dimension::Id::X);
layout->registerDim(Dimension::Id::Y);
view.setField(Dimension::Id::X, 0, 0);
view.setField(Dimension::Id::Y, 0, 0);
view.setField(Dimension::Id::X, 1, 1);
view.setField(Dimension::Id::Y, 1, 1);
EXPECT_THROW(KD3Index index(view2), pdal_error);
}
示例5:
XMLSchema::XMLSchema(const PointLayoutPtr& layout, MetadataNode m,
Orientation orientation) : m_orientation(orientation), m_metadata(m)
{
DimTypeList dimTypes = layout->dimTypes();
for (DimType& d : dimTypes)
m_dims.push_back(XMLDim(d, layout->dimName(d.m_id)));
}
示例6: addDimensions
void LOFFilter::addDimensions(PointLayoutPtr layout)
{
using namespace Dimension;
m_kdist = layout->registerOrAssignDim("KDistance", Type::Double);
m_lrd = layout->registerOrAssignDim("LocalReachabilityDistance", Type::Double);
m_lof = layout->registerOrAssignDim("LocalOutlierFactor", Type::Double);
}
示例7: addDimensions
void FauxReader::addDimensions(PointLayoutPtr layout)
{
layout->registerDims(getDefaultDimensions());
if (m_numReturns > 0)
{
layout->registerDim(Dimension::Id::ReturnNumber);
layout->registerDim(Dimension::Id::NumberOfReturns);
}
}
示例8: layout
void FerryFilter::ready(PointTableRef table)
{
const PointLayoutPtr layout(table.layout());
for (const auto& dim_par : m_name_map)
{
Dimension::Id f = layout->findDim(dim_par.first);
Dimension::Id t = layout->findDim(dim_par.second);
m_dimensions_map.insert(std::make_pair(f,t));
}
}
示例9: layout
void RangeFilter::prepared(PointTableRef table)
{
const PointLayoutPtr layout(table.layout());
for (auto& r : m_range_list)
{
r.m_id = layout->findDim(r.m_name);
if (r.m_id == Dimension::Id::Unknown)
throwError("Invalid dimension name in 'limits' option: '" +
r.m_name + "'.");
}
std::sort(m_range_list.begin(), m_range_list.end());
}
示例10: addDimensions
void FerryFilter::addDimensions(PointLayoutPtr layout)
{
for (auto& info : m_dims)
{
const Dimension::Id fromId = layout->findDim(info.m_fromName);
// Dimensions being created with the "=>Dim" syntax won't
// be in the layout, so we have to assign a default type.
Dimension::Type fromType = layout->dimType(fromId);
if (fromType == Dimension::Type::None)
fromType = Dimension::Type::Double;
info.m_toId = layout->registerOrAssignDim(info.m_toName, fromType);
}
}
示例11: layout
void TextWriter::writeCSVHeader(PointTableRef table)
{
const PointLayoutPtr layout(table.layout());
for (auto di = m_dims.begin(); di != m_dims.end(); ++di)
{
if (di != m_dims.begin())
*m_stream << m_delimiter;
if (m_quoteHeader)
*m_stream << "\"" << layout->dimName(*di) << "\"";
else
*m_stream << layout->dimName(*di);
}
*m_stream << m_newline;
}
示例12: addDimensions
void PlyReader::addDimensions(PointLayoutPtr layout)
{
for (auto it : m_vertexDimensions)
{
layout->registerDim(it.second);
}
}
示例13: addDimensions
void MrsidReader::addDimensions(PointLayoutPtr layout)
{
using namespace Dimension;
if (!m_PS)
throw pdal_error("MrSID object not initialized!");
const LizardTech::PointInfo& pointinfo = m_PS->getPointInfo();
// add a map for PDAL names that aren't the same as LT ones (GPSTime vs Time)
std::map<std::string, std::string> dimensionTranslations;
dimensionTranslations.insert(std::pair<std::string, std::string>("Time", "GPSTime"));
dimensionTranslations.insert(std::pair<std::string, std::string>("NumReturns", "NumberOfReturns"));
dimensionTranslations.insert(std::pair<std::string, std::string>("ReturnNum", "ReturnNumber"));
dimensionTranslations.insert(std::pair<std::string, std::string>("ScanDir", "ScanDirectionFlag"));
dimensionTranslations.insert(std::pair<std::string, std::string>("EdgeFlightLine", "EdgeOfFlightLine"));
dimensionTranslations.insert(std::pair<std::string, std::string>("ScanAngle", "ScanAngleRank"));
dimensionTranslations.insert(std::pair<std::string, std::string>("ClassId", "Classification"));
dimensionTranslations.insert(std::pair<std::string, std::string>("SourceId", "PointSourceId"));
for (unsigned int i=0; i<pointinfo.getNumChannels(); i++)
{
const LizardTech::ChannelInfo &channel = pointinfo.getChannel(i);
const char* name = channel.getName();
auto translated = dimensionTranslations.find(name);
if (translated != dimensionTranslations.end())
name = translated->second.c_str();
LizardTech::DataType t = channel.getDataType();
Dimension::Type::Enum pdal_type = getPDALType(t);
layout->registerOrAssignDim(name, pdal_type);
}
m_layout = layout;
}
示例14: addDimensions
void FerryFilter::addDimensions(PointLayoutPtr layout)
{
for (const auto& dim_par : m_name_map)
{
layout->registerOrAssignDim(dim_par.second, Dimension::Type::Double);
}
}
示例15: addDimensions
void NormalFilter::addDimensions(PointLayoutPtr layout)
{
using namespace Dimension;
layout->registerDims(
{Id::NormalX, Id::NormalY, Id::NormalZ, Id::Curvature});
}