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)); }
void printLasHeader(std::ostream& out, const liblas::Header& header) { out << "[Filter] Header: "; out << "Offset=" << math::Vector3d(header.GetOffsetX(), header.GetOffsetY(), header.GetOffsetZ()); out << "Min=" << math::Vector3d(header.GetMinX(), header.GetMinY(), header.GetMinZ()); out << "Max=" << math::Vector3d(header.GetMaxX(), header.GetMaxY(), header.GetMaxZ()); out << std::endl; }
void LidarMetadata::setFromLasHeader(liblas::Header const& theHeader) { mNumOfPoints = theHeader.GetPointRecordsCount(); mMinX = theHeader.GetMinX(); mMaxX = theHeader.GetMaxX(); mMinY = theHeader.GetMinY(); mMaxY = theHeader.GetMaxY(); mMinZ = theHeader.GetMinZ(); mMaxZ = theHeader.GetMaxZ(); QString crsDesc = QString::fromStdString(theHeader.GetSRS().GetProj4()); if (crsDesc != "") mCrs = new QgsCoordinateReferenceSystem(); //The caller should check if CRS is valid and if it is not, call projection selector }
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)); }