QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgslazdecoder.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslazdecoder.h
3 --------------------
4 begin : March 2022
5 copyright : (C) 2022 by Belgacem Nedjima
6 email : belgacem dot nedjima at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSLAZDECODER_H
19#define QGSLAZDECODER_H
20
21
22#include <string>
23
25#include "qgspointcloudblock.h"
26
27#include <QString>
28
30#define SIP_NO_FILE
31
32
33class QgsPointCloudExpression;
34class QgsLazInfo;
35class QgsRectangle;
36
37template <typename T>
38bool lazStoreToStream_( char *s, size_t position, QgsPointCloudAttribute::DataType type, T value );
39bool lazSerialize_( char *data, size_t outputPosition, QgsPointCloudAttribute::DataType outputType,
40 const char *input, QgsPointCloudAttribute::DataType inputType, int inputSize, size_t inputPosition );
41
42class QgsLazDecoder
43{
44 public:
45
46 enum class LazAttribute
47 {
48 X,
49 Y,
50 Z,
51 Classification,
52 Intensity,
53 ReturnNumber,
54 NumberOfReturns,
55 ScanDirectionFlag,
56 EdgeOfFlightLine,
57 ScanAngleRank,
58 UserData,
59 PointSourceId,
60 GpsTime,
61 Red,
62 Green,
63 Blue,
64 ScannerChannel,
65 Synthetic,
66 KeyPoint,
67 Withheld,
68 Overlap,
69 NIR,
70 ExtraBytes,
71 MissingOrUnknown
72 };
73
74 struct RequestedAttributeDetails
75 {
76 RequestedAttributeDetails( LazAttribute attribute, QgsPointCloudAttribute::DataType type, int size, int offset = -1 )
77 : attribute( attribute )
78 , type( type )
79 , size( size )
80 , offset( offset )
81 {}
82
83 LazAttribute attribute;
85 int size;
86 int offset; // Used in case the attribute is an extra byte attribute
87 };
88
89 static std::unique_ptr<QgsPointCloudBlock> decompressLaz( const QString &filename, const QgsPointCloudAttributeCollection &requestedAttributes, QgsPointCloudExpression &filterExpression, QgsRectangle &filterRect );
90 static std::unique_ptr<QgsPointCloudBlock> decompressLaz( const QByteArray &data, const QgsPointCloudAttributeCollection &requestedAttributes, QgsPointCloudExpression &filterExpression, QgsRectangle &filterRect );
91 static std::unique_ptr<QgsPointCloudBlock> decompressCopc( const QByteArray &data, QgsLazInfo &lazInfo, int32_t pointCount, const QgsPointCloudAttributeCollection &requestedAttributes, QgsPointCloudExpression &filterExpression, QgsRectangle &filterRect );
92
93#if defined(_MSC_VER)
94
100 static std::wstring toNativePath( const QString &filename );
101#else
103 static std::string toNativePath( const QString &filename );
104#endif
105
106};
107
109#endif // QGSLAZDECODER_H
Extracts information contained in a LAZ file, such as the public header block and variable length rec...
Definition qgslazinfo.h:38
DataType
Systems of unit measurement.
A rectangle specified with double values.