QGIS API Documentation 3.41.0-Master (57ec4277f5e)
Loading...
Searching...
No Matches
qgseptpointcloudindex.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspointcloudindex.h
3 --------------------
4 begin : October 2020
5 copyright : (C) 2020 by Peter Petrik
6 email : zilolv 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 QGSEPTPOINTCLOUDINDEX_H
19#define QGSEPTPOINTCLOUDINDEX_H
20
21#include <QString>
22#include <QHash>
23#include <QStringList>
24#include <QVector>
25#include <QList>
26#include <QFile>
27
28#include "qgspointcloudindex.h"
29#include "qgis_sip.h"
30#include "qgsvector3d.h"
31
33#define SIP_NO_FILE
34
36
37class CORE_EXPORT QgsEptPointCloudIndex: public QgsPointCloudIndex
38{
39 public:
40
41 explicit QgsEptPointCloudIndex();
42 ~QgsEptPointCloudIndex();
43
44 std::unique_ptr<QgsPointCloudIndex> clone() const override;
45
46 void load( const QString &fileName ) override;
47
48 std::unique_ptr<QgsPointCloudBlock> nodeData( const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request ) override;
50 bool hasNode( const QgsPointCloudNodeId &n ) const override;
51
52 QgsCoordinateReferenceSystem crs() const override;
53 qint64 pointCount() const override;
54 QgsPointCloudNode getNode( const QgsPointCloudNodeId &id ) const override;
55 QVariantMap originalMetadata() const override { return mOriginalMetadata; }
57
58 bool isValid() const override;
60
65 void copyCommonProperties( QgsEptPointCloudIndex *destination ) const;
66
67 protected:
68 bool loadSchema( const QByteArray &dataJson );
69 void loadManifest( const QByteArray &manifestJson );
70 bool loadSchema( QFile &f );
71 bool loadSingleNodeHierarchy( const QgsPointCloudNodeId &nodeId ) const;
72 QVector<QgsPointCloudNodeId> nodePathToRoot( const QgsPointCloudNodeId &nodeId ) const;
73 bool loadNodeHierarchy( const QgsPointCloudNodeId &nodeId ) const;
74
75 bool mIsValid = false;
77 QString mDataType;
78 QString mWkt;
79
80 QString mUrlDirectoryPart;
81
83 mutable QSet<QgsPointCloudNodeId> mHierarchyNodes;
84
85 qint64 mPointCount = 0;
86
87 struct AttributeStatistics
88 {
89 int count = -1;
90 QVariant minimum;
91 QVariant maximum;
92 double mean = std::numeric_limits< double >::quiet_NaN();
93 double stDev = std::numeric_limits< double >::quiet_NaN();
94 double variance = std::numeric_limits< double >::quiet_NaN();
95 };
96
97 QMap< QString, AttributeStatistics > mMetadataStats;
98
99 QMap< QString, QMap< int, int > > mAttributeClasses;
100 QVariantMap mOriginalMetadata;
101};
102
104#endif // QGSEPTPOINTCLOUDINDEX_H
This class represents a coordinate reference system (CRS).
Base class for handling loading QgsPointCloudBlock asynchronously.
Represents a indexed point clouds data in octree.
virtual bool hasNode(const QgsPointCloudNodeId &n) const
Returns whether the octree contain given node.
AccessType
The access type of the data, local is for local files and remote for remote files (over HTTP)
@ Local
Local means the source is a local file on the machine.
virtual qint64 pointCount() const =0
Returns the number of points in the point cloud.
void copyCommonProperties(QgsPointCloudIndex *destination) const
Copies common properties to the destination index.
virtual AccessType accessType() const =0
Returns the access type of the data If the access type is Remote, data will be fetched from an HTTP s...
virtual std::unique_ptr< QgsPointCloudIndex > clone() const =0
Returns a clone of the current point cloud index object.
virtual bool isValid() const =0
Returns whether index is loaded and valid.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate reference system of the point cloud index.
virtual QgsPointCloudStatistics metadataStatistics() const
Returns the object containing the statistics metadata extracted from the dataset.
virtual QgsPointCloudBlockRequest * asyncNodeData(const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)=0
Returns a handle responsible for loading a node data block.
virtual void load(const QString &fileName)=0
Loads the index from the file.
virtual QgsPointCloudNode getNode(const QgsPointCloudNodeId &id) const
Returns object for a given node.
virtual QVariantMap originalMetadata() const =0
Returns the original metadata map.
virtual std::unique_ptr< QgsPointCloudBlock > nodeData(const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)=0
Returns node data block.
Represents a indexed point cloud node's position in octree.
Keeps metadata for indexed point cloud node.
Point cloud data request.
Class used to store statistics of a point cloud dataset.