Пример #1
0
void test_file10_header(liblas::Header const& h)
{
    ensure_equals(h.GetFileSignature(), liblas::Header::FileSignature);
    ensure_equals(h.GetFileSourceId(), 0);
    ensure_equals(h.GetReserved(), 0);

    boost::uuids::uuid g = boost::uuids::nil_uuid();
    ensure_equals(g, boost::uuids::nil_uuid());
    ensure_equals("wrong ProjectId", h.GetProjectId(), g);

    ensure_equals("wrong VersionMajor", h.GetVersionMajor(), 1);
    ensure_equals("wrong VersionMinor", h.GetVersionMinor(), 0);
    ensure_equals("wrong GetSystemId", h.GetSystemId(), std::string(""));
    ensure_equals("wrong GetSoftwareId", h.GetSoftwareId(), std::string("TerraScan"));
    ensure_equals("Wrong GetCreationDOY", h.GetCreationDOY(), 0);
    ensure_equals("Wrong GetCreationYear", h.GetCreationYear(), 0);
    ensure_equals("Wrong GetHeaderSize", h.GetHeaderSize(), boost::uint16_t(227));
    ensure_equals("Wrong GetDataOffset", h.GetDataOffset(), boost::uint32_t(229));
    ensure_equals("Wrong GetRecordsCount", h.GetRecordsCount(), boost::uint32_t(0));
    ensure_equals("Wrong GetDataFormatId", h.GetDataFormatId(), liblas::ePointFormat1);
    ensure_equals("Wrong GetDataRecordLength", h.GetDataRecordLength(), liblas::ePointSize1);
    ensure_equals("Wrong GetPointRecordsCount", h.GetPointRecordsCount(), boost::uint32_t(8));
    ensure_equals("Wrong GetScaleX", h.GetScaleX(), double(0.01));
    ensure_equals("Wrong GetScaleY", h.GetScaleY(), double(0.01));
    ensure_equals("Wrong GetScaleZ", h.GetScaleZ(), double(0.01));
    ensure_equals("Wrong GetOffsetX", h.GetOffsetX(),double(-0));
    ensure_equals("Wrong GetOffsetY", h.GetOffsetY(), double(-0));
    ensure_equals("Wrong GetOffsetZ", h.GetOffsetZ(), double(-0));
    ensure_equals("Wrong GetMinX", h.GetMinX(), double(630262.3));
    ensure_equals("Wrong GetMaxX", h.GetMaxX(), double(630346.83));
    ensure_equals("Wrong GetMinY", h.GetMinY(), double(4834500));
    ensure_equals("Wrong GetMaxY", h.GetMaxY(), double(4834500));
    ensure_equals("Wrong GetMinZ", h.GetMinZ(), double(50.9));
    ensure_equals("Wrong GetMaxZ", h.GetMaxZ(), double(55.26));
}
Пример #2
0
void PrintVLRs(std::ostream& os, liblas::Header const& header)
{
    if (!header.GetRecordsCount())
        return ;
        
    os << "---------------------------------------------------------" << std::endl;
    os << "  VLR Summary" << std::endl;
    os << "---------------------------------------------------------" << std::endl;
    
    typedef std::vector<VariableRecord>::size_type size_type;
    for(size_type i = 0; i < header.GetRecordsCount(); i++) {
        liblas::VariableRecord const& v = header.GetVLR(i);
        os << v;
    }
    
}
Пример #3
0
void test_default_header(liblas::Header const& h)
{
    using liblas::Header;

    ensure_equals("wrong default file signature",
        h.GetFileSignature(), Header::FileSignature);

    ensure_equals("wrong default file source id",
        h.GetFileSourceId(), 0);
    ensure_equals("wrong default reserved value",
        h.GetReserved(), 0);

    boost::uuids::uuid g = boost::uuids::nil_uuid();
    ensure_equals("wrong default project guid",
        h.GetProjectId(), g);

    ensure_equals("wrong default major version",
        h.GetVersionMajor(), 1);
    ensure_equals("wrong default minor version",
        h.GetVersionMinor(), 2);

    ensure_equals("wrong default system id",
        h.GetSystemId(), Header::SystemIdentifier);
    ensure_equals("wrong default software id",
        h.GetSoftwareId(), Header::SoftwareIdentifier);

    // TODO: Fix me to use todays day # and year
    // ensure_equals("wrong default creation day-of-year",
    //     h.GetCreationDOY(), 0);
    // ensure_equals("wrong default creation year",
    //     h.GetCreationYear(), 0);
    ensure_equals("wrong default header size",
        h.GetHeaderSize(), boost::uint16_t(227));
    
    boost::uint32_t offset = 229;
    if (h.GetVersionMinor() == 1 || h.GetVersionMinor() == 2)
    {
        offset = 227;
    }
    ensure_equals("wrong default data offset",
        h.GetDataOffset(), offset);
    
    ensure_equals("wrong default records count",
        h.GetRecordsCount(), boost::uint32_t(0));
    ensure_equals("wrong default data format id",
        h.GetDataFormatId(), liblas::ePointFormat3);
    ensure_equals("wrong default data record length",
        h.GetDataRecordLength(), liblas::ePointSize3);
    ensure_equals("wrong default point records count",
        h.GetPointRecordsCount(), boost::uint32_t(0));

    ensure_equals("wrong default X scale", h.GetScaleX(), double(1.0));
    ensure_equals("wrong default Y scale", h.GetScaleY(), double(1.0));
    ensure_equals("wrong default Z scale", h.GetScaleZ(), double(1.0));

    ensure_equals("wrong default X offset", h.GetOffsetX(), double(0));
    ensure_equals("wrong default Y offset", h.GetOffsetY(), double(0));
    ensure_equals("wrong default Z offset", h.GetOffsetZ(), double(0));

    ensure_equals("wrong default min X", h.GetMinX(), double(0));
    ensure_equals("wrong default max X", h.GetMaxX(), double(0));
    ensure_equals("wrong default min Y", h.GetMinY(), double(0));
    ensure_equals("wrong default max Y", h.GetMaxY(), double(0));
    ensure_equals("wrong default min Z", h.GetMinZ(), double(0));
    ensure_equals("wrong default max Z", h.GetMaxZ(), double(0));
}