QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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 "qgspointcloudindex.h"
22
23#include <QFile>
24#include <QHash>
25#include <QList>
26#include <QString>
27#include <QStringList>
28#include <QVector>
29
31#define SIP_NO_FILE
32
34
35class CORE_EXPORT QgsEptPointCloudIndex: public QgsAbstractPointCloudIndex
36{
37 public:
38
39 explicit QgsEptPointCloudIndex();
40 ~QgsEptPointCloudIndex() override;
41
42 void load( const QString &urlString, const QString &authcfg = QString() ) override;
43
44 std::unique_ptr<QgsPointCloudBlock> nodeData( const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request ) override;
45 QgsPointCloudBlockRequest *asyncNodeData( const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request ) override;
46 bool hasNode( const QgsPointCloudNodeId &n ) const override;
47
48 QgsCoordinateReferenceSystem crs() const override;
49 qint64 pointCount() const override;
50 QgsPointCloudNode getNode( const QgsPointCloudNodeId &id ) const override;
51 QVariantMap originalMetadata() const override { return mOriginalMetadata; }
52 QgsPointCloudStatistics metadataStatistics() const override;
53
54 bool isValid() const override;
56
57 protected:
58 bool loadSchema( const QByteArray &dataJson );
59 void loadManifest( const QByteArray &manifestJson );
60 bool loadSchema( QFile &f );
61 bool loadSingleNodeHierarchy( const QgsPointCloudNodeId &nodeId ) const;
62 QVector<QgsPointCloudNodeId> nodePathToRoot( const QgsPointCloudNodeId &nodeId ) const;
63 bool loadNodeHierarchy( const QgsPointCloudNodeId &nodeId ) const;
64
65 bool mIsValid = false;
67 QString mDataType;
68 QString mWkt;
69
70 QString mUrlDirectoryPart;
71
73 mutable QSet<QgsPointCloudNodeId> mHierarchyNodes;
74
75 qint64 mPointCount = 0;
76
77 struct AttributeStatistics
78 {
79 int count = -1;
80 QVariant minimum;
81 QVariant maximum;
82 double mean = std::numeric_limits< double >::quiet_NaN();
83 double stDev = std::numeric_limits< double >::quiet_NaN();
84 double variance = std::numeric_limits< double >::quiet_NaN();
85 };
86
87 QMap< QString, AttributeStatistics > mMetadataStats;
88
89 QMap< QString, QMap< int, int > > mAttributeClasses;
90 QVariantMap mOriginalMetadata;
91};
92
94#endif // QGSEPTPOINTCLOUDINDEX_H
PointCloudAccessType
The access type of the data, local is for local files and remote for remote files (over HTTP).
Definition qgis.h:6074
@ Local
Local means the source is a local file on the machine.
Definition qgis.h:6075
Represents an indexed point clouds data in octree.
virtual QVariantMap originalMetadata() const =0
Returns the original metadata map.
virtual qint64 pointCount() const =0
Returns the number of points in the point cloud.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate reference system of the point cloud index.
virtual bool hasNode(const QgsPointCloudNodeId &n) const
Returns whether the octree contain given node.
virtual QgsPointCloudBlockRequest * asyncNodeData(const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)=0
Returns a handle responsible for loading a node data block.
virtual Qgis::PointCloudAccessType 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 QgsPointCloudStatistics metadataStatistics() const
Returns the object containing the statistics metadata extracted from the dataset.
virtual void load(const QString &uri, const QString &authcfg=QString())=0
Loads the index from the uri, using an optional authcfg for network requests.
virtual std::unique_ptr< QgsPointCloudBlock > nodeData(const QgsPointCloudNodeId &n, const QgsPointCloudRequest &request)=0
Returns node data block.
virtual bool isValid() const =0
Returns whether index is loaded and valid.
virtual QgsPointCloudNode getNode(const QgsPointCloudNodeId &id) const
Returns object for a given node.
Represents a coordinate reference system (CRS).