QGIS API Documentation 3.41.0-Master (d2aaa9c6e02)
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 "qgspointcloudblock.h"
24
25#include <string>
26#include <QString>
27
29#define SIP_NO_FILE
30
31
32class QgsPointCloudExpression;
33class QgsLazInfo;
34class QgsRectangle;
35
36template <typename T>
37bool lazStoreToStream_( char *s, size_t position, QgsPointCloudAttribute::DataType type, T value );
38bool lazSerialize_( char *data, size_t outputPosition, QgsPointCloudAttribute::DataType outputType,
39 const char *input, QgsPointCloudAttribute::DataType inputType, int inputSize, size_t inputPosition );
40bool lazStoreDoubleToStream( char *s, size_t position, QgsPointCloudAttribute::DataType type, double value );
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
Class for extracting information contained in LAZ file such as the public header block and variable l...
Definition qgslazinfo.h:39
Collection of point cloud attributes.
DataType
Systems of unit measurement.
A rectangle specified with double values.