当前位置: 首页>>代码示例>>C++>>正文


C++ PointTableRef类代码示例

本文整理汇总了C++中PointTableRef的典型用法代码示例。如果您正苦于以下问题:C++ PointTableRef类的具体用法?C++ PointTableRef怎么用?C++ PointTableRef使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PointTableRef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readyTable

void LasWriter::readyTable(PointTableRef table)
{
    m_firstPoint = true;
    m_forwardMetadata = table.privateMetadata("lasforward");
    if(m_writePDALMetadata)
    {
        MetadataNode m = table.metadata();
        addMetadataVlr(m);
        addPipelineVlr();
    }
    addExtraBytesVlr();
    addUserVlrs();
    addForwardVlrs();
}
开发者ID:connormanning,项目名称:PDAL,代码行数:14,代码来源:LasWriter.cpp

示例2: prepared

void LocateFilter::prepared(PointTableRef table)
{
    PointLayoutPtr layout(table.layout());
    m_dimId = layout->findDim(m_dimName);
    if (m_dimId == Dimension::Id::Unknown)
        throwError("Invalid dimension '" + m_dimName + "'.");
}
开发者ID:PDAL,项目名称:PDAL,代码行数:7,代码来源:LocateFilter.cpp

示例3: ready

void ColorizationFilter::ready(PointTableRef table)
{
    m_forward_transform.assign(0.0);
    m_inverse_transform.assign(0.0);

    log()->get(LogLevel::Debug) << "Using " << m_rasterFilename <<
        " for raster" << std::endl;
    m_ds = GDALOpen(m_rasterFilename.c_str(), GA_ReadOnly);
    if (m_ds == NULL)
        throw pdal_error("Unable to open GDAL datasource!");

    if (GDALGetGeoTransform(m_ds, &(m_forward_transform.front())) != CE_None)
        throw pdal_error("unable to fetch forward geotransform for raster!");

    if (!GDALInvGeoTransform(&(m_forward_transform.front()),
        &(m_inverse_transform.front())))
        throw pdal_error("unable to fetch inverse geotransform for raster!");

    for (auto bi = m_bands.begin(); bi != m_bands.end(); ++bi)
    {
        if (bi->m_dim == Dimension::Id::Unknown)
            bi->m_dim = table.layout()->findDim(bi->m_name);
        if (bi->m_dim == Dimension::Id::Unknown)
            throw pdal_error((std::string)"Can't colorize - no dimension " +
                bi->m_name);
    }
}
开发者ID:boundlessgeo,项目名称:PDAL,代码行数:27,代码来源:ColorizationFilter.cpp

示例4: 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)));
    }
}
开发者ID:EricAlex,项目名称:PDAL,代码行数:29,代码来源:DbWriter.cpp

示例5: done

// Deferring write until this time allows both points and faces from multiple
// point views to be written.
void PlyWriter::done(PointTableRef table)
{
    for (auto& v : m_views)
    {
        PointRef point(*v, 0);
        for (PointId idx = 0; idx < v->size(); ++idx)
        {
            point.setPointId(idx);
            writePoint(point, table.layout());
        }
    }
    if (m_faces)
    {
        PointId offset = 0;
        for (auto& v : m_views)
        {
            TriangularMesh *mesh = v->mesh();
            if (mesh)
            {
                for (size_t id = 0; id < mesh->size(); ++id)
                {
                    const Triangle& t = (*mesh)[id];
                    writeTriangle(t, offset);
                }
            }
            offset += v->size();
        }
    }
    Utils::closeFile(m_stream);
    m_stream = nullptr;
    getMetadata().addList("filename", m_filename);
}
开发者ID:pblottiere,项目名称:PDAL,代码行数:34,代码来源:PlyWriter.cpp

示例6: prepared

void GreyhoundReader::prepared(PointTableRef table)
{
    MetadataNode queryNode(table.privateMetadata("greyhound"));
    queryNode.add("info", dense(m_info));
    queryNode.add("root", m_params.root());
    queryNode.add("params", dense(m_params.toJson()));
}
开发者ID:chambbj,项目名称:PDAL,代码行数:7,代码来源:GreyhoundReader.cpp

示例7: ready

void AttributeFilter::ready(PointTableRef table)
{
    m_gdal_debug = std::shared_ptr<pdal::gdal::Debug>(
        new pdal::gdal::Debug(isDebug(), log()));

    for (auto& dim_par : m_dimensions)
    {
        Dimension::Id::Enum t = table.layout()->findDim(dim_par.first);
        dim_par.second.dim = t;

        if (dim_par.second.isogr)
        {

            OGRDSPtr ds = OGRDSPtr(OGROpen(dim_par.second.datasource.c_str(), 0, 0), OGRDataSourceDeleter());
            if (!ds)
            {
                std::ostringstream oss;
                oss << "Unable to open data source '" << dim_par.second.datasource <<"'";
                throw pdal_error(oss.str());
            }
            dim_par.second.ds = ds;
        }

    }
}
开发者ID:ezhangle,项目名称:PDAL,代码行数:25,代码来源:AttributeFilter.cpp

示例8: ready

void ProgrammableFilter::ready(PointTableRef table)
{
    plang::Environment::get()->set_stdout(log()->getLogStream());
    m_script = new plang::Script(m_source, m_module, m_function);
    m_pythonMethod = new plang::BufferedInvocation(*m_script);
    m_pythonMethod->compile();
    m_totalMetadata = table.metadata();
}
开发者ID:Rafaelaniemann,项目名称:PDAL,代码行数:8,代码来源:ProgrammableFilter.cpp

示例9: ready

 void GeoWaveWriter::ready(PointTableRef table)
 {
     // get a list of all the dimensions & their types
     Dimension::IdList all = table.layout()->dims();
     for (auto di = all.begin(); di != all.end(); ++di)
         if (!Utils::contains(m_dims, *di))
             m_dims.push_back(*di);
 }
开发者ID:PDAL,项目名称:PDAL,代码行数:8,代码来源:GeoWaveWriter.cpp

示例10: prepared

void GroupByFilter::prepared(PointTableRef table)
{
    PointLayoutPtr layout(table.layout());
    m_dimId = layout->findDim(m_dimName);
    if (m_dimId == Dimension::Id::Unknown)
        throwError("Invalid dimension name '" + m_dimName + "'.");
    // also need to check that we have a dimension with discrete values
}
开发者ID:PDAL,项目名称:PDAL,代码行数:8,代码来源:GroupByFilter.cpp

示例11: ready

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));
    }
}
开发者ID:Rafaelaniemann,项目名称:PDAL,代码行数:10,代码来源:FerryFilter.cpp

示例12: ready

void PlyWriter::ready(PointTableRef table)
{
    if (pointCount() > std::numeric_limits<uint32_t>::max())
        throwError("Can't write PLY file.  Only " +
            std::to_string(std::numeric_limits<uint32_t>::max()) +
            " points supported.");

    m_stream = Utils::createFile(m_filename, true);
    writeHeader(table.layout());
}
开发者ID:pblottiere,项目名称:PDAL,代码行数:10,代码来源:PlyWriter.cpp

示例13: prepared

void AttributeFilter::prepared(PointTableRef table)
{
    m_dim = table.layout()->findDim(m_dimName);
    if (m_dim == Dimension::Id::Unknown)
    {
        std::ostringstream oss;
        oss << getName() << ": Dimension '" << m_dimName << "' not found.";
        throw pdal_error(oss.str());
    }
}
开发者ID:kirkjens,项目名称:PDAL,代码行数:10,代码来源:AttributeFilter.cpp

示例14: prepared

void FerryFilter::prepared(PointTableRef table)
{
    for (auto& info : m_dims)
    {
        info.m_fromId = table.layout()->findDim(info.m_fromName);
        if (info.m_fromId == Dimension::Id::Unknown && info.m_fromName.size())
            throwError("Can't ferry dimension '" + info.m_fromName + "'. "
                "Dimension doesn't exist.");
    }
}
开发者ID:PDAL,项目名称:PDAL,代码行数:10,代码来源:FerryFilter.cpp

示例15: execute

PointViewSet Stage::execute(PointTableRef table)
{



    //printf("called %s\n", this->classname());
    log()->setLevel(LogLevel::Enum::Debug);

    std::string cn(this->classname());
    log()->setLeader(cn + " Stage::execute");
    log()->get(LogLevel::Debug) << "Called by class " << std::endl;

    table.layout()->finalize();

    PointViewSet views;
    if (m_inputs.empty())
    {
        log()->get(LogLevel::Debug) << "if block, class" << std::endl;
        views.insert(PointViewPtr(new PointView(table)));
    }
    else
    {
        for (size_t i = 0; i < m_inputs.size(); ++i)
        {
            log()->get(LogLevel::Debug) << "block, class"
                    << "input number "<< i << std::endl;
            log()->get(LogLevel::Debug) << "if block, class" << std::endl;
            Stage *prev = m_inputs[i];
            PointViewSet temp = prev->execute(table);
            views.insert(temp.begin(), temp.end());
        }
    }

    PointViewSet outViews;
    std::vector<StageRunnerPtr> runners;

    ready(table);
    for (auto const& it : views)
    {
        log()->get(LogLevel::Debug) << "run, class" << std::endl;
        StageRunnerPtr runner(new StageRunner(this, it));
        runners.push_back(runner);
        runner->run();
    }
    for (auto const& it : runners)
    {
        log()->get(LogLevel::Debug) << "wait, class" << std::endl;
        StageRunnerPtr runner(it);
        PointViewSet temp = runner->wait();
        outViews.insert(temp.begin(), temp.end());
    }
    l_done(table);
    done(table);
    return outViews;
}
开发者ID:jwend,项目名称:PDAL,代码行数:55,代码来源:Stage.cpp


注:本文中的PointTableRef类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。