Exemple #1
0
void FauxReader::addDimensions(PointContextRef ctx)
{
    ctx.registerDims(getDefaultDimensions());
    if (m_numReturns > 0)
    {
        ctx.registerDim(Dimension::Id::ReturnNumber);
        ctx.registerDim(Dimension::Id::NumberOfReturns);
    }
}
Exemple #2
0
void BpfReader::addDimensions(PointContextRef ctx)
{
    for (size_t i = 0; i < m_dims.size(); ++i)
    {
        BpfDimension& dim = m_dims[i];
        dim.m_id = ctx.registerOrAssignDim(dim.m_label, Dimension::Type::Float);
    }
}
Exemple #3
0
void GreyhoundReader::addDimensions(PointContextRef pointContext)
{
    // Get Greyhound schema.
    exchanges::GetSchema schemaExchange(m_sessionId);
    m_wsClient.exchange(schemaExchange);

    m_dimData = schemaExchange.schema();

    for (auto dim : m_dimData)
    {
        pointContext.registerDim(dim.id, dim.type);
        m_pointByteSize += pdal::Dimension::size(dim.type);
    }
}
Exemple #4
0
void DbWriter::ready(PointContextRef ctx)
{
    using namespace Dimension;

    // Determine if X, Y and Z values should be written as Signed32 along with
    // a scale factor and offset instead of being written as Double.
    m_locationScaling = (m_xXform.nonstandard() || m_yXform.nonstandard() ||
        m_zXform.nonstandard());
    m_dimTypes = ctx.dimTypes();

    auto cmp = [](const DimType& d1, const DimType& d2) -> bool
    {
        long id1 = d1.m_id;
        long id2 = d2.m_id;

        // Put X, Y and Z at the end of the list.
        if (id1 == Id::X || id1 == Id::Y || id1 == Id::Z)
            id1 += 1000000;
        if (id2 == Id::X || id2 == Id::Y || id2 == Id::Z)
            id2 += 1000000;
        return id1 < id2;
    };

    // Sorting messes up the offsets in the DimType objects.
    std::sort(m_dimTypes.begin(), m_dimTypes.end(), cmp);

    // Now store away the offset of X, Y and Z if they exist.
    m_xPackedOffset = -1;
    m_yPackedOffset = -1;
    m_zPackedOffset = -1;
    int offset = 0;
    for (auto di = m_dimTypes.begin(); di != m_dimTypes.end(); ++di)
    {
        if (di->m_id == Id::X)
            m_xPackedOffset = offset;
        else if (di->m_id == Id::Y)
            m_yPackedOffset = offset;
        else if (di->m_id == Id::Z)
            m_zPackedOffset = offset;
        offset += Dimension::size(di->m_type);
    }
    m_packedPointSize = offset;
}
Exemple #5
0
void SbetReader::addDimensions(PointContextRef ctx)
{
    ctx.registerDims(getDefaultDimensions());
}
Exemple #6
0
void QfitReader::addDimensions(PointContextRef ctx)
{
    using namespace Dimension;

    m_size = 0;
    ctx.registerDim(Id::OffsetTime);
    ctx.registerDim(Id::Y);
    ctx.registerDim(Id::X);
    ctx.registerDim(Id::Z);
    ctx.registerDim(Id::StartPulse);
    ctx.registerDim(Id::ReflectedPulse);
    ctx.registerDim(Id::ScanAngleRank);
    ctx.registerDim(Id::Pitch);
    ctx.registerDim(Id::Roll);
    m_size += 36;

    if (m_format == QFIT_Format_12)
    {
        ctx.registerDim(Id::Pdop);
        ctx.registerDim(Id::PulseWidth);
        m_size += 8;
    }
    else if (m_format == QFIT_Format_14)
    {
        ctx.registerDim(Id::PassiveSignal);
        ctx.registerDim(Id::PassiveY);
        ctx.registerDim(Id::PassiveX);
        ctx.registerDim(Id::PassiveZ);
        m_size += 16;
    }
    m_size += 4;  // For the GPS time that we currently discard.
}
Exemple #7
0
void TerrasolidReader::addDimensions(PointContextRef ctx)
{
    m_size = 0;
    ctx.registerDim(Dimension::Id::Classification);
    ctx.registerDim(Dimension::Id::PointSourceId);
    ctx.registerDim(Dimension::Id::Intensity);
    ctx.registerDim(Dimension::Id::X);
    ctx.registerDim(Dimension::Id::Y);
    ctx.registerDim(Dimension::Id::Z);
    if (m_format == TERRASOLID_Format_2)
    {
        ctx.registerDim(Dimension::Id::ReturnNumber);
        ctx.registerDim(Dimension::Id::Flag);
        ctx.registerDim(Dimension::Id::Mark);
    }
    if (m_format == TERRASOLID_Format_1)
        m_size = 16;
    else if (m_format == TERRASOLID_Format_2)
        m_size = 20;

    if (m_haveTime)
    {
        ctx.registerDim(Dimension::Id::OffsetTime);
        m_size += 4;
    }

    if (m_haveColor)
    {
        ctx.registerDim(Dimension::Id::Red);
        ctx.registerDim(Dimension::Id::Green);
        ctx.registerDim(Dimension::Id::Blue);
        ctx.registerDim(Dimension::Id::Alpha);
        m_size += 4;
    }
}