QGIS API Documentation 3.43.0-Master (c67cf405802)
qgscopcpointcloudindex.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgscopcpointcloudindex.cpp
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
19
20#include <fstream>
21#include <QFile>
22#include <QtDebug>
23#include <QQueue>
24#include <QMutexLocker>
25#include <QJsonDocument>
26#include <QJsonObject>
27#include <qnamespace.h>
28
29#include "qgsapplication.h"
30#include "qgsbox3d.h"
33#include "qgseptdecoder.h"
34#include "qgslazdecoder.h"
37#include "qgspointcloudindex.h"
40#include "qgslogger.h"
41#include "qgsmessagelog.h"
42#include "qgspointcloudexpression.h"
43
44#include "lazperf/vlr.hpp"
46
48
49#define PROVIDER_KEY QStringLiteral( "copc" )
50#define PROVIDER_DESCRIPTION QStringLiteral( "COPC point cloud provider" )
51
52QgsCopcPointCloudIndex::QgsCopcPointCloudIndex() = default;
53
54QgsCopcPointCloudIndex::~QgsCopcPointCloudIndex() = default;
55
56void QgsCopcPointCloudIndex::load( const QString &urlString )
57{
58 QUrl url = urlString;
59 // Treat non-URLs as local files
60 if ( url.isValid() && ( url.scheme() == "http" || url.scheme() == "https" ) )
62 else
63 {
65 mCopcFile.open( QgsLazDecoder::toNativePath( urlString ), std::ios::binary );
66 if ( mCopcFile.fail() )
67 {
68 mError = QObject::tr( "Unable to open %1 for reading" ).arg( urlString );
69 mIsValid = false;
70 return;
71 }
72 }
73 mUri = urlString;
74
75 if ( mAccessType == Qgis::PointCloudAccessType::Remote )
76 mLazInfo.reset( new QgsLazInfo( QgsLazInfo::fromUrl( url ) ) );
77 else
78 mLazInfo.reset( new QgsLazInfo( QgsLazInfo::fromFile( mCopcFile ) ) );
79 mIsValid = mLazInfo->isValid();
80 if ( mIsValid )
81 {
82 mIsValid = loadSchema( *mLazInfo.get() );
83 if ( mIsValid )
84 {
85 loadHierarchy();
86 }
87 }
88 if ( !mIsValid )
89 {
90 mError = QObject::tr( "Unable to recognize %1 as a LAZ file: \"%2\"" ).arg( urlString, mLazInfo->error() );
91 }
92}
93
94bool QgsCopcPointCloudIndex::loadSchema( QgsLazInfo &lazInfo )
95{
96 QByteArray copcInfoVlrData = lazInfo.vlrData( QStringLiteral( "copc" ), 1 );
97 if ( copcInfoVlrData.isEmpty() )
98 {
99 mError = QObject::tr( "Invalid COPC file" );
100 return false;
101 }
102 mCopcInfoVlr.fill( copcInfoVlrData.data(), copcInfoVlrData.size() );
103
104 mScale = lazInfo.scale();
105 mOffset = lazInfo.offset();
106
107 mOriginalMetadata = lazInfo.toMetadata();
108
109 QgsVector3D minCoords = lazInfo.minCoords();
110 QgsVector3D maxCoords = lazInfo.maxCoords();
111 mExtent.set( minCoords.x(), minCoords.y(), maxCoords.x(), maxCoords.y() );
112 mZMin = minCoords.z();
113 mZMax = maxCoords.z();
114
115 setAttributes( lazInfo.attributes() );
116
117 const double xmin = mCopcInfoVlr.center_x - mCopcInfoVlr.halfsize;
118 const double ymin = mCopcInfoVlr.center_y - mCopcInfoVlr.halfsize;
119 const double zmin = mCopcInfoVlr.center_z - mCopcInfoVlr.halfsize;
120 const double xmax = mCopcInfoVlr.center_x + mCopcInfoVlr.halfsize;
121 const double ymax = mCopcInfoVlr.center_y + mCopcInfoVlr.halfsize;
122 const double zmax = mCopcInfoVlr.center_z + mCopcInfoVlr.halfsize;
123
124 mRootBounds = QgsBox3D( xmin, ymin, zmin, xmax, ymax, zmax );
125
126 // TODO: Rounding?
127 mSpan = mRootBounds.width() / mCopcInfoVlr.spacing;
128
129#ifdef QGISDEBUG
130 double dx = xmax - xmin, dy = ymax - ymin, dz = zmax - zmin;
131 QgsDebugMsgLevel( QStringLiteral( "lvl0 node size in CRS units: %1 %2 %3" ).arg( dx ).arg( dy ).arg( dz ), 2 ); // all dims should be the same
132 QgsDebugMsgLevel( QStringLiteral( "res at lvl0 %1" ).arg( dx / mSpan ), 2 );
133 QgsDebugMsgLevel( QStringLiteral( "res at lvl1 %1" ).arg( dx / mSpan / 2 ), 2 );
134 QgsDebugMsgLevel( QStringLiteral( "res at lvl2 %1 with node size %2" ).arg( dx / mSpan / 4 ).arg( dx / 4 ), 2 );
135#endif
136
137 return true;
138}
139
140std::unique_ptr<QgsPointCloudBlock> QgsCopcPointCloudIndex::nodeData( const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request )
141{
142 if ( QgsPointCloudBlock *cached = getNodeDataFromCache( n, request ) )
143 {
144 return std::unique_ptr<QgsPointCloudBlock>( cached );
145 }
146
147 std::unique_ptr<QgsPointCloudBlock> block;
148 if ( mAccessType == Qgis::PointCloudAccessType::Local )
149 {
150 QByteArray rawBlockData = rawNodeData( n );
151 if ( rawBlockData.isEmpty() )
152 return nullptr; // Error fetching block
153
154 mHierarchyMutex.lock();
155 auto pointCount = mHierarchy.value( n );
156 mHierarchyMutex.unlock();
157
158 // we need to create a copy of the expression to pass to the decoder
159 // as the same QgsPointCloudExpression object mighgt be concurrently
160 // used on another thread, for example in a 3d view
161 QgsPointCloudExpression filterExpression = request.ignoreIndexFilterEnabled() ? QgsPointCloudExpression() : mFilterExpression;
162 QgsPointCloudAttributeCollection requestAttributes = request.attributes();
163 requestAttributes.extend( attributes(), filterExpression.referencedAttributes() );
164
165 QgsRectangle filterRect = request.filterRect();
166
167 block = QgsLazDecoder::decompressCopc( rawBlockData, *mLazInfo.get(), pointCount, requestAttributes, filterExpression, filterRect );
168 }
169 else
170 {
171
172 std::unique_ptr<QgsPointCloudBlockRequest> blockRequest( asyncNodeData( n, request ) );
173 if ( !blockRequest )
174 return nullptr;
175
176 QEventLoop loop;
177 QObject::connect( blockRequest.get(), &QgsPointCloudBlockRequest::finished, &loop, &QEventLoop::quit );
178 loop.exec();
179
180 block = blockRequest->takeBlock();
181
182 if ( !block )
183 QgsDebugError( QStringLiteral( "Error downloading node %1 data, error : %2 " ).arg( n.toString(), blockRequest->errorStr() ) );
184 }
185
186 storeNodeDataToCache( block.get(), n, request );
187 return block;
188}
189
190QgsPointCloudBlockRequest *QgsCopcPointCloudIndex::asyncNodeData( const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request )
191{
192 if ( mAccessType == Qgis::PointCloudAccessType::Local )
193 return nullptr; // TODO
194 if ( QgsPointCloudBlock *cached = getNodeDataFromCache( n, request ) )
195 {
196 return new QgsCachedPointCloudBlockRequest( cached, n, mUri, attributes(), request.attributes(),
197 scale(), offset(), mFilterExpression, request.filterRect() );
198 }
199
200 if ( !fetchNodeHierarchy( n ) )
201 return nullptr;
202 QMutexLocker locker( &mHierarchyMutex );
203
204 // we need to create a copy of the expression to pass to the decoder
205 // as the same QgsPointCloudExpression object might be concurrently
206 // used on another thread, for example in a 3d view
207 QgsPointCloudExpression filterExpression = request.ignoreIndexFilterEnabled() ? QgsPointCloudExpression() : mFilterExpression;
208 QgsPointCloudAttributeCollection requestAttributes = request.attributes();
209 requestAttributes.extend( attributes(), filterExpression.referencedAttributes() );
210 auto [ blockOffset, blockSize ] = mHierarchyNodePos.value( n );
211 int pointCount = mHierarchy.value( n );
212
213 return new QgsCopcPointCloudBlockRequest( n, mUri, attributes(), requestAttributes,
214 scale(), offset(), filterExpression, request.filterRect(),
215 blockOffset, blockSize, pointCount, *mLazInfo.get() );
216}
217
218
219const QByteArray QgsCopcPointCloudIndex::rawNodeData( QgsPointCloudNodeId n ) const
220{
221 const bool found = fetchNodeHierarchy( n );
222 if ( !found )
223 return {};
224 mHierarchyMutex.lock();
225 auto [blockOffset, blockSize] = mHierarchyNodePos.value( n );
226 mHierarchyMutex.unlock();
227
228 if ( mAccessType == Qgis::PointCloudAccessType::Local )
229 {
230 // Open a new file descriptor so we can read multiple blocks concurrently
231 QByteArray rawBlockData( blockSize, Qt::Initialization::Uninitialized );
232 std::ifstream file( QgsLazDecoder::toNativePath( mUri ), std::ios::binary );
233 file.seekg( blockOffset );
234 file.read( rawBlockData.data(), blockSize );
235 if ( !file )
236 {
237 QgsDebugError( QStringLiteral( "Could not read file %1" ).arg( mUri ) );
238 return {};
239 }
240 return rawBlockData;
241 }
242 else
243 return readRange( blockOffset, blockSize );
244}
245
246QgsCoordinateReferenceSystem QgsCopcPointCloudIndex::crs() const
247{
248 return mLazInfo->crs();
249}
250
251qint64 QgsCopcPointCloudIndex::pointCount() const
252{
253 return mLazInfo->pointCount();
254}
255
256bool QgsCopcPointCloudIndex::loadHierarchy() const
257{
258 fetchHierarchyPage( mCopcInfoVlr.root_hier_offset, mCopcInfoVlr.root_hier_size );
259 return true;
260}
261
262bool QgsCopcPointCloudIndex::writeStatistics( QgsPointCloudStatistics &stats )
263{
264 if ( mAccessType == Qgis::PointCloudAccessType::Remote )
265 {
266 QgsMessageLog::logMessage( QObject::tr( "Can't write statistics to remote file \"%1\"" ).arg( mUri ) );
267 return false;
268 }
269
270 if ( mLazInfo->version() != qMakePair<uint8_t, uint8_t>( 1, 4 ) )
271 {
272 // EVLR isn't supported in the first place
273 QgsMessageLog::logMessage( QObject::tr( "Can't write statistics to \"%1\": laz version != 1.4" ).arg( mUri ) );
274 return false;
275 }
276
277 QByteArray statisticsEvlrData = fetchCopcStatisticsEvlrData();
278 if ( !statisticsEvlrData.isEmpty() )
279 {
280 QgsMessageLog::logMessage( QObject::tr( "Can't write statistics to \"%1\": file already contains COPC statistics!" ).arg( mUri ) );
281 return false;
282 }
283
284 lazperf::evlr_header statsEvlrHeader;
285 statsEvlrHeader.user_id = "qgis";
286 statsEvlrHeader.record_id = 0;
287 statsEvlrHeader.description = "Contains calculated statistics";
288 QByteArray statsJson = stats.toStatisticsJson();
289 statsEvlrHeader.data_length = statsJson.size();
290
291 // Save the EVLRs to the end of the original file (while erasing the existing EVLRs in the file)
292 QMutexLocker locker( &mFileMutex );
293 mCopcFile.close();
294 std::fstream copcFile;
295 copcFile.open( QgsLazDecoder::toNativePath( mUri ), std::ios_base::binary | std::iostream::in | std::iostream::out );
296 if ( copcFile.is_open() && copcFile.good() )
297 {
298 // Write the new number of EVLRs
299 lazperf::header14 header = mLazInfo->header();
300 header.evlr_count = header.evlr_count + 1;
301 copcFile.seekp( 0 );
302 header.write( copcFile );
303
304 // Append EVLR data to the end
305 copcFile.seekg( 0, std::ios::end );
306
307 statsEvlrHeader.write( copcFile );
308 copcFile.write( statsJson.data(), statsEvlrHeader.data_length );
309 }
310 else
311 {
312 QgsMessageLog::logMessage( QObject::tr( "Couldn't open COPC file \"%1\" to write statistics" ).arg( mUri ) );
313 return false;
314 }
315 copcFile.close();
316 mCopcFile.open( QgsLazDecoder::toNativePath( mUri ), std::ios::binary );
317 return true;
318}
319
320QgsPointCloudStatistics QgsCopcPointCloudIndex::metadataStatistics() const
321{
322 if ( ! mStatistics )
323 {
324 const QByteArray statisticsEvlrData = fetchCopcStatisticsEvlrData();
325 if ( statisticsEvlrData.isEmpty() )
327 else
328 mStatistics = QgsPointCloudStatistics::fromStatisticsJson( statisticsEvlrData );
329 }
330
331 return *mStatistics;
332}
333
334bool QgsCopcPointCloudIndex::isValid() const
335{
336 return mIsValid;
337}
338
339bool QgsCopcPointCloudIndex::fetchNodeHierarchy( const QgsPointCloudNodeId &n ) const
340{
341 QMutexLocker locker( &mHierarchyMutex );
342
343 QVector<QgsPointCloudNodeId> ancestors;
344 QgsPointCloudNodeId foundRoot = n;
345 while ( !mHierarchy.contains( foundRoot ) )
346 {
347 ancestors.push_front( foundRoot );
348 foundRoot = foundRoot.parentNode();
349 }
350 ancestors.push_front( foundRoot );
351 for ( QgsPointCloudNodeId n : ancestors )
352 {
353 auto hierarchyIt = mHierarchy.constFind( n );
354 if ( hierarchyIt == mHierarchy.constEnd() )
355 return false;
356 int nodesCount = *hierarchyIt;
357 if ( nodesCount < 0 )
358 {
359 auto hierarchyNodePos = mHierarchyNodePos.constFind( n );
360 mHierarchyMutex.unlock();
361 fetchHierarchyPage( hierarchyNodePos->first, hierarchyNodePos->second );
362 mHierarchyMutex.lock();
363 }
364 }
365 return mHierarchy.contains( n );
366}
367
368void QgsCopcPointCloudIndex::fetchHierarchyPage( uint64_t offset, uint64_t byteSize ) const
369{
370 Q_ASSERT( byteSize > 0 );
371
372 QByteArray data = readRange( offset, byteSize );
373 if ( data.isEmpty() )
374 return;
375
376 populateHierarchy( data.constData(), byteSize );
377}
378
379void QgsCopcPointCloudIndex::populateHierarchy( const char *hierarchyPageData, uint64_t byteSize ) const
380{
381 struct CopcVoxelKey
382 {
383 int32_t level;
384 int32_t x;
385 int32_t y;
386 int32_t z;
387 };
388
389 struct CopcEntry
390 {
391 CopcVoxelKey key;
392 uint64_t offset;
393 int32_t byteSize;
394 int32_t pointCount;
395 };
396
397 QMutexLocker locker( &mHierarchyMutex );
398
399 for ( uint64_t i = 0; i < byteSize; i += sizeof( CopcEntry ) )
400 {
401 const CopcEntry *entry = reinterpret_cast<const CopcEntry *>( hierarchyPageData + i );
402 const QgsPointCloudNodeId nodeId( entry->key.level, entry->key.x, entry->key.y, entry->key.z );
403 mHierarchy[nodeId] = entry->pointCount;
404 mHierarchyNodePos.insert( nodeId, QPair<uint64_t, int32_t>( entry->offset, entry->byteSize ) );
405 }
406}
407
408bool QgsCopcPointCloudIndex::hasNode( const QgsPointCloudNodeId &n ) const
409{
410 return fetchNodeHierarchy( n );
411}
412
413QgsPointCloudNode QgsCopcPointCloudIndex::getNode( const QgsPointCloudNodeId &id ) const
414{
415 bool nodeFound = fetchNodeHierarchy( id );
416 Q_ASSERT( nodeFound );
417
418 qint64 pointCount;
419 {
420 QMutexLocker locker( &mHierarchyMutex );
421 pointCount = mHierarchy.value( id, -1 );
422 }
423
424 QList<QgsPointCloudNodeId> children;
425 children.reserve( 8 );
426 const int d = id.d() + 1;
427 const int x = id.x() * 2;
428 const int y = id.y() * 2;
429 const int z = id.z() * 2;
430
431 for ( int i = 0; i < 8; ++i )
432 {
433 int dx = i & 1, dy = !!( i & 2 ), dz = !!( i & 4 );
434 const QgsPointCloudNodeId n2( d, x + dx, y + dy, z + dz );
435 bool found = fetchNodeHierarchy( n2 );
436 {
437 QMutexLocker locker( &mHierarchyMutex );
438 if ( found && mHierarchy[id] >= 0 )
439 children.append( n2 );
440 }
441 }
442
443 QgsBox3D bounds = QgsPointCloudNode::bounds( mRootBounds, id );
444 return QgsPointCloudNode( id, pointCount, children, bounds.width() / mSpan, bounds );
445}
446
447QByteArray QgsCopcPointCloudIndex::readRange( uint64_t offset, uint64_t length ) const
448{
449 if ( mAccessType == Qgis::PointCloudAccessType::Local )
450 {
451 QMutexLocker locker( &mFileMutex );
452
453 QByteArray buffer( length, Qt::Initialization::Uninitialized );
454 mCopcFile.seekg( offset );
455 mCopcFile.read( buffer.data(), length );
456 if ( mCopcFile.eof() )
457 QgsDebugError( QStringLiteral( "Read past end of file (path %1 offset %2 length %3)" ).arg( mUri ).arg( offset ).arg( length ) );
458 if ( !mCopcFile )
459 QgsDebugError( QStringLiteral( "Error reading %1" ).arg( mUri ) );
460 return buffer;
461 }
462 else
463 {
464 QNetworkRequest nr = QNetworkRequest( QUrl( mUri ) );
465 QgsSetRequestInitiatorClass( nr, QStringLiteral( "QgsCopcPointCloudIndex" ) );
466 nr.setAttribute( QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache );
467 nr.setAttribute( QNetworkRequest::CacheSaveControlAttribute, true );
468 QByteArray queryRange = QStringLiteral( "bytes=%1-%2" ).arg( offset ).arg( offset + length - 1 ).toLocal8Bit();
469 nr.setRawHeader( "Range", queryRange );
470
471 std::unique_ptr<QgsTileDownloadManagerReply> reply( QgsApplication::tileDownloadManager()->get( nr ) );
472
473 QEventLoop loop;
474 QObject::connect( reply.get(), &QgsTileDownloadManagerReply::finished, &loop, &QEventLoop::quit );
475 loop.exec();
476
477 if ( reply->error() != QNetworkReply::NoError )
478 {
479 QgsDebugError( QStringLiteral( "Request failed: %1 (offset %1 length %2)" ).arg( mUri ).arg( offset ).arg( length ) );
480 return {};
481 }
482
483 return reply->data();
484 }
485}
486
487QByteArray QgsCopcPointCloudIndex::fetchCopcStatisticsEvlrData() const
488{
489 uint64_t offset = mLazInfo->firstEvlrOffset();
490 uint32_t evlrCount = mLazInfo->evlrCount();
491
492 QByteArray statisticsEvlrData;
493
494 for ( uint32_t i = 0; i < evlrCount; ++i )
495 {
496 lazperf::evlr_header header;
497
498 QByteArray buffer = readRange( offset, 60 );
499 header.fill( buffer.data(), buffer.size() );
500
501 if ( header.user_id == "qgis" && header.record_id == 0 )
502 {
503 statisticsEvlrData = readRange( offset + 60, header.data_length );
504 break;
505 }
506
507 offset += 60 + header.data_length;
508 }
509
510 return statisticsEvlrData;
511}
512
513void QgsCopcPointCloudIndex::reset()
514{
515 // QgsAbstractPointCloudIndex
516 mExtent = QgsRectangle();
517 mZMin = 0;
518 mZMax = 0;
519 mHierarchy.clear();
520 mScale = QgsVector3D();
521 mOffset = QgsVector3D();
522 mRootBounds = QgsBox3D();
523 mAttributes = QgsPointCloudAttributeCollection();
524 mSpan = 0;
525 mError.clear();
526
527 // QgsCopcPointCloudIndex
528 mIsValid = false;
530 mCopcFile.close();
531 mOriginalMetadata.clear();
532 mStatistics.reset();
533 mLazInfo.reset();
534 mHierarchyNodePos.clear();
535}
536
537QVariantMap QgsCopcPointCloudIndex::extraMetadata() const
538{
539 return
540 {
541 { QStringLiteral( "CopcGpsTimeFlag" ), mLazInfo.get()->header().global_encoding & 1 },
542 };
543}
544
@ Local
Local means the source is a local file on the machine.
@ Remote
Remote means it's loaded through a protocol like HTTP.
virtual QgsPointCloudStatistics metadataStatistics() const
Returns the object containing the statistics metadata extracted from the dataset.
static QgsTileDownloadManager * tileDownloadManager()
Returns the application's tile download manager, used for download of map tiles when rendering.
A 3-dimensional box composed of x, y, z coordinates.
Definition qgsbox3d.h:43
double width() const
Returns the width of the box.
Definition qgsbox3d.h:278
Handles a QgsPointCloudBlockRequest using existing cached QgsPointCloudBlock.
Represents a coordinate reference system (CRS).
Base class for handling loading QgsPointCloudBlock asynchronously from a remote COPC dataset.
Extracts information contained in a LAZ file, such as the public header block and variable length rec...
Definition qgslazinfo.h:39
QgsVector3D maxCoords() const
Returns the maximum coordinate across X, Y and Z axis.
Definition qgslazinfo.h:95
QgsPointCloudAttributeCollection attributes() const
Returns the list of attributes contained in the LAZ file.
Definition qgslazinfo.h:120
QByteArray vlrData(QString userId, int recordId)
Returns the binary data of the variable length record with the user identifier userId and record iden...
static QgsLazInfo fromUrl(QUrl &url)
Static function to create a QgsLazInfo class from a file over network.
QVariantMap toMetadata() const
Returns a map containing various metadata extracted from the LAZ file.
QgsVector3D scale() const
Returns the scale of the points coordinates.
Definition qgslazinfo.h:77
static QgsLazInfo fromFile(std::ifstream &file)
Static function to create a QgsLazInfo class from a file.
QgsVector3D minCoords() const
Returns the minimum coordinate across X, Y and Z axis.
Definition qgslazinfo.h:93
QgsVector3D offset() const
Returns the offset of the points coordinates.
Definition qgslazinfo.h:79
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true, const char *file=__builtin_FILE(), const char *function=__builtin_FUNCTION(), int line=__builtin_LINE())
Adds a message to the log instance (and creates it if necessary).
A collection of point cloud attributes.
void extend(const QgsPointCloudAttributeCollection &otherCollection, const QSet< QString > &matchingNames)
Adds specific missing attributes from another QgsPointCloudAttributeCollection.
Base class for handling loading QgsPointCloudBlock asynchronously.
void finished()
Emitted when the request processing has finished.
Base class for storing raw data from point cloud nodes.
Represents an indexed point cloud node's position in octree.
QString toString() const
Encode node to string.
QgsPointCloudNodeId parentNode() const
Returns the parent of the node.
Keeps metadata for an indexed point cloud node.
QgsBox3D bounds() const
Returns node's bounding cube in CRS coords.
Point cloud data request.
bool ignoreIndexFilterEnabled() const
Returns whether the request will ignore the point cloud index's filter expression,...
QgsPointCloudAttributeCollection attributes() const
Returns attributes.
QgsRectangle filterRect() const
Returns the rectangle from which points will be taken, in point cloud's crs.
Used to store statistics of a point cloud dataset.
static QgsPointCloudStatistics fromStatisticsJson(const QByteArray &stats)
Creates a statistics object from the JSON object stats.
QByteArray toStatisticsJson() const
Converts the current statistics object into JSON object.
A rectangle specified with double values.
void finished()
Emitted when the reply has finished (either with a success or with a failure)
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
Definition qgsvector3d.h:30
double y() const
Returns Y coordinate.
Definition qgsvector3d.h:49
double z() const
Returns Z coordinate.
Definition qgsvector3d.h:51
double x() const
Returns X coordinate.
Definition qgsvector3d.h:47
void set(double x, double y, double z)
Sets vector coordinates.
Definition qgsvector3d.h:72
#define QgsDebugMsgLevel(str, level)
Definition qgslogger.h:41
#define QgsDebugError(str)
Definition qgslogger.h:40
#define QgsSetRequestInitiatorClass(request, _class)