QGIS API Documentation 3.99.0-Master (a8f284845db)
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
29#define SIP_NO_FILE
30
32
33
34class QgsPointCloudExpression;
35class QgsLazInfo;
36class QgsRectangle;
37
38template <typename T>
39bool lazStoreToStream_( char *s, size_t position, QgsPointCloudAttribute::DataType type, T value );
40bool lazSerialize_( char *data, size_t outputPosition, QgsPointCloudAttribute::DataType outputType,
41 const char *input, QgsPointCloudAttribute::DataType inputType, int inputSize, size_t inputPosition );
42
43class QgsLazDecoder
44{
45 public:
46
47 enum class LazAttribute
48 {
49 X,
50 Y,
51 Z,
52 Classification,
53 Intensity,
54 ReturnNumber,
55 NumberOfReturns,
56 ScanDirectionFlag,
57 EdgeOfFlightLine,
58 ScanAngleRank,
59 UserData,
60 PointSourceId,
61 GpsTime,
62 Red,
63 Green,
64 Blue,
65 ScannerChannel,
66 Synthetic,
67 KeyPoint,
68 Withheld,
69 Overlap,
70 NIR,
71 ExtraBytes,
72 MissingOrUnknown
73 };
74
75 struct RequestedAttributeDetails
76 {
77 RequestedAttributeDetails( LazAttribute attribute, QgsPointCloudAttribute::DataType type, int size, int offset = -1 )
78 : attribute( attribute )
79 , type( type )
80 , size( size )
81 , offset( offset )
82 {}
83
84 LazAttribute attribute;
86 int size;
87 int offset; // Used in case the attribute is an extra byte attribute
88 };
89
90 static std::unique_ptr<QgsPointCloudBlock> decompressLaz( const QString &filename, const QgsPointCloudAttributeCollection &requestedAttributes, QgsPointCloudExpression &filterExpression, QgsRectangle &filterRect );
91 static std::unique_ptr<QgsPointCloudBlock> decompressLaz( const QByteArray &data, const QgsPointCloudAttributeCollection &requestedAttributes, QgsPointCloudExpression &filterExpression, QgsRectangle &filterRect );
92 static std::unique_ptr<QgsPointCloudBlock> decompressCopc( const QByteArray &data, QgsLazInfo &lazInfo, int32_t pointCount, const QgsPointCloudAttributeCollection &requestedAttributes, QgsPointCloudExpression &filterExpression, QgsRectangle &filterRect );
93
94#if defined(_MSC_VER)
95
101 static std::wstring toNativePath( const QString &filename );
102#else
104 static std::string toNativePath( const QString &filename );
105#endif
106
107};
108
110#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.