QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
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 );
40
41class QgsLazDecoder
42{
43 public:
44
45 enum class LazAttribute
46 {
47 X,
48 Y,
49 Z,
50 Classification,
51 Intensity,
52 ReturnNumber,
53 NumberOfReturns,
54 ScanDirectionFlag,
55 EdgeOfFlightLine,
56 ScanAngleRank,
57 UserData,
58 PointSourceId,
59 GpsTime,
60 Red,
61 Green,
62 Blue,
63 ScannerChannel,
64 ClassificationFlags,
65 NIR,
66 ExtraBytes,
67 MissingOrUnknown
68 };
69
70 struct RequestedAttributeDetails
71 {
72 RequestedAttributeDetails( LazAttribute attribute, QgsPointCloudAttribute::DataType type, int size, int offset = -1 )
73 : attribute( attribute )
74 , type( type )
75 , size( size )
76 , offset( offset )
77 {}
78
79 LazAttribute attribute;
81 int size;
82 int offset; // Used in case the attribute is an extra byte attribute
83 };
84
85 static std::unique_ptr<QgsPointCloudBlock> decompressLaz( const QString &filename, const QgsPointCloudAttributeCollection &requestedAttributes, QgsPointCloudExpression &filterExpression, QgsRectangle &filterRect );
86 static std::unique_ptr<QgsPointCloudBlock> decompressLaz( const QByteArray &data, const QgsPointCloudAttributeCollection &requestedAttributes, QgsPointCloudExpression &filterExpression, QgsRectangle &filterRect );
87 static std::unique_ptr<QgsPointCloudBlock> decompressCopc( const QByteArray &data, QgsLazInfo &lazInfo, int32_t pointCount, const QgsPointCloudAttributeCollection &requestedAttributes, QgsPointCloudExpression &filterExpression, QgsRectangle &filterRect );
88
89#if defined(_MSC_VER)
90
96 static std::wstring toNativePath( const QString &filename );
97#else
99 static std::string toNativePath( const QString &filename );
100#endif
101
102};
103
105#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.