Example #1
0
Dimension::IdList LasHeader::usedDims() const
{
    using namespace Dimension;

    Dimension::Id::Enum dims[] = { Id::ReturnNumber, Id::NumberOfReturns,
        Id::X, Id::Y, Id::Z, Id::Intensity, Id::ScanChannel,
        Id::ScanDirectionFlag, Id::EdgeOfFlightLine, Id::Classification,
        Id::UserData, Id::ScanAngleRank, Id::PointSourceId };

    // This mess is because MSVC doesn't support initializer lists.
    Dimension::IdList ids;
    std::copy(std::begin(dims), std::end(dims), std::back_inserter(ids));

    if (hasTime())
        ids.push_back(Id::GpsTime);
    if (hasColor())
    {
        ids.push_back(Id::Red);
        ids.push_back(Id::Green);
        ids.push_back(Id::Blue);
    }
    if (hasInfrared())
        ids.push_back(Id::Infrared);

    return ids;
}
Example #2
0
Dimension::IdList FauxReader::getDefaultDimensions()
{
    Dimension::IdList ids;

    ids.push_back(Dimension::Id::X);
    ids.push_back(Dimension::Id::Y);
    ids.push_back(Dimension::Id::Z);
    ids.push_back(Dimension::Id::OffsetTime);
    return ids;
}
Example #3
0
Dimension::IdList Ilvis2Reader::getDefaultDimensions()
{
    using namespace pdal::Dimension;
    Dimension::IdList ids;

    ids.push_back(Id::GpsTime);
    ids.push_back(Id::Y);
    ids.push_back(Id::X);
    ids.push_back(Id::Z);
    return ids;
}
Example #4
0
Dimension::IdList Reader::getDefaultDimensions()
{
    Dimension::IdList ids;

    using namespace Dimension;

    ids.push_back(Id::OffsetTime);
    ids.push_back(Id::Y);
    ids.push_back(Id::X);
    ids.push_back(Id::Z);
    ids.push_back(Id::StartPulse);
    ids.push_back(Id::ReflectedPulse);
    ids.push_back(Id::ScanAngleRank);
    ids.push_back(Id::Pitch);
    ids.push_back(Id::Roll);
    ids.push_back(Id::Pdop);
    ids.push_back(Id::PulseWidth);
    ids.push_back(Id::GpsTime);
    return ids;
}
Example #5
0
Dimension::IdList OptechReader::getDefaultDimensions()
{
    Dimension::IdList dims;
    dims.push_back(Dimension::Id::X);
    dims.push_back(Dimension::Id::Y);
    dims.push_back(Dimension::Id::Z);
    dims.push_back(Dimension::Id::GpsTime);
    dims.push_back(Dimension::Id::ReturnNumber);
    dims.push_back(Dimension::Id::NumberOfReturns);
    dims.push_back(Dimension::Id::EchoRange);
    dims.push_back(Dimension::Id::Intensity);
    dims.push_back(Dimension::Id::ScanAngleRank);
    return dims;
}
Example #6
0
void BpfWriter::loadBpfDimensions(PointLayoutPtr layout)
{
    Dimension::IdList dims;

    if (m_outputDims.size())
    {
        for (std::string& s : m_outputDims)
        {
            Dimension::Id::Enum id = layout->findDim(s);
            if (id == Dimension::Id::Unknown)
            {
                std::ostringstream oss;
                oss << "Invalid dimension '" << s << "' specified for "
                    "'output_dims' option.";
                throw pdal_error(oss.str());
            }
            dims.push_back(id);
        }
    }
    else
        dims = layout->dims();

    // Verify that we have X, Y and Z and that they're the first three
    // dimensions.
    std::sort(dims.begin(), dims.end());
    if (dims.size() < 3 || dims[0] != Dimension::Id::X ||
            dims[1] != Dimension::Id::Y || dims[2] != Dimension::Id::Z)
    {
        throw pdal_error("Missing one of dimensions X, Y or Z.  "
                         "Can't write BPF.");
    }

    for (auto id : dims)
    {
        BpfDimension dim;
        dim.m_id = id;
        dim.m_label = layout->dimName(id);
        m_dims.push_back(dim);
    }
}
Example #7
0
Dimension::IdList QfitReader::getDefaultDimensions()
{
    Dimension::IdList ids;

    ids.push_back(Dimension::Id::OffsetTime);
    ids.push_back(Dimension::Id::Y);
    ids.push_back(Dimension::Id::X);
    ids.push_back(Dimension::Id::Z);
    ids.push_back(Dimension::Id::StartPulse);
    ids.push_back(Dimension::Id::ReflectedPulse);
    ids.push_back(Dimension::Id::ScanAngleRank);
    ids.push_back(Dimension::Id::Pitch);
    ids.push_back(Dimension::Id::Roll);
    ids.push_back(Dimension::Id::Pdop);
    ids.push_back(Dimension::Id::PulseWidth);
    ids.push_back(Dimension::Id::PassiveSignal);
    ids.push_back(Dimension::Id::PassiveY);
    ids.push_back(Dimension::Id::PassiveX);
    ids.push_back(Dimension::Id::PassiveZ);

    return ids;
}