コード例 #1
0
ファイル: Mosaic.cpp プロジェクト: mweisman/PDAL
void Mosaic::initialize()
{
    MultiFilter::initialize();

    const std::vector<Stage*>& stages = getPrevStages();

    const Stage& stage0 = *stages[0];
    const SpatialReference& srs0 = stage0.getSpatialReference();
    const Schema& schema0 = stage0.getSchema();
    PointCountType pointCountType0 = stage0.getPointCountType();
    boost::uint64_t totalPoints = stage0.getNumPoints();
    Bounds<double> bigbox(stage0.getBounds());

    // we will only mosaic if all the stages have the same core properties: SRS, schema, etc
    for (boost::uint32_t i=1; i<stages.size(); i++)
    {
        Stage& stage = *(stages[i]);
        if (stage.getSpatialReference() != srs0)
            throw impedance_invalid("mosaicked stages must have same srs");
        if (stage.getSchema() != schema0)
            throw impedance_invalid("mosaicked stages must have same schema");
        if (stage.getPointCountType() == PointCount_Unknown)
            pointCountType0 = PointCount_Unknown;

        totalPoints += stage.getNumPoints();

        bigbox.grow(stage.getBounds());
    }

    if (pointCountType0 == PointCount_Unknown)
        totalPoints = 0;

    setCoreProperties(stage0);
    setPointCountType(pointCountType0);
    setNumPoints(totalPoints);

    return;
}
コード例 #2
0
void Reprojection::checkImpedance()
{
    const Schema& schema = this->getSchema();
    
    boost::optional<Dimension const&> x = schema.getDimension("X");
    boost::optional<Dimension const&> y = schema.getDimension("Y");
    boost::optional<Dimension const&> z = schema.getDimension("Z");
    
    if (!(x->getByteSize() != 8) ||
        !(y->getByteSize() != 8) ||
        !(z->getByteSize() != 8) )
    {
        throw impedance_invalid("Reprojection filter requires X,Y,Z dimensions as doubles");
    }

    return;
}