/
qgsremoteeptpointcloudindex.h
102 lines (77 loc) · 3.51 KB
/
qgsremoteeptpointcloudindex.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/***************************************************************************
qgsremoteeptpointcloudindex.h
--------------------
begin : March 2021
copyright : (C) 2021 by Belgacem Nedjima
email : belgacem dot nedjima at gmail dot com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSREMOTEEPTPOINTCLOUDINDEX_H
#define QGSREMOTEEPTPOINTCLOUDINDEX_H
#include <QObject>
#include <QString>
#include <QHash>
#include <QStringList>
#include <QVector>
#include <QList>
#include <QFile>
#include <QUrl>
#include "qgspointcloudindex.h"
#include "qgspointcloudattribute.h"
#include "qgsstatisticalsummary.h"
#include "qgis_sip.h"
///@cond PRIVATE
#define SIP_NO_FILE
class QgsCoordinateReferenceSystem;
class QgsTileDownloadManager;
class CORE_EXPORT QgsRemoteEptPointCloudIndex: public QgsPointCloudIndex
{
Q_OBJECT
public:
explicit QgsRemoteEptPointCloudIndex();
~QgsRemoteEptPointCloudIndex();
QList<IndexedPointCloudNode> nodeChildren( const IndexedPointCloudNode &n ) const override;
void load( const QString &fileName ) override;
QgsPointCloudBlock *nodeData( const IndexedPointCloudNode &n, const QgsPointCloudRequest &request ) override;
QgsPointCloudBlockHandle *asyncNodeData( const IndexedPointCloudNode &n, const QgsPointCloudRequest &request ) override;
QgsCoordinateReferenceSystem crs() const override;
int pointCount() const override;
QVariant metadataStatistic( const QString &attribute, QgsStatisticalSummary::Statistic statistic ) const override;
QVariantList metadataClasses( const QString &attribute ) const override;
QVariant metadataClassStatistic( const QString &attribute, const QVariant &value, QgsStatisticalSummary::Statistic statistic ) const override;
QVariantMap originalMetadata() const override { return mOriginalMetadata; }
bool isValid() const override;
QgsPointCloudIndex::AccessType accessType() const override { return QgsPointCloudIndex::Remote; }
private:
bool loadSchema( const QByteArray &data );
bool loadNodeHierarchy( const IndexedPointCloudNode &nodeId ) const;
bool mIsValid = false;
QString mDataType;
QString mUrlDirectoryPart;
QString mUrlFileNamePart;
QString mWkt;
QUrl mUrl;
int mPointCount = 0;
struct AttributeStatistics
{
int count = -1;
QVariant minimum;
QVariant maximum;
double mean = std::numeric_limits< double >::quiet_NaN();
double stDev = std::numeric_limits< double >::quiet_NaN();
double variance = std::numeric_limits< double >::quiet_NaN();
};
QMap< QString, AttributeStatistics > mMetadataStats;
QMap< QString, QMap< int, int > > mAttributeClasses;
QVariantMap mOriginalMetadata;
QgsTileDownloadManager *mTileDownloadManager = nullptr;
};
///@endcond
#endif // QGSREMOTEEPTPOINTCLOUDINDEX_H