QGIS API Documentation 3.41.0-Master (d2aaa9c6e02)
Loading...
Searching...
No Matches
qgspointclouddataprovider.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspointclouddataprovider.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 QGSPOINTCLOUDDATAPROVIDER_H
19#define QGSPOINTCLOUDDATAPROVIDER_H
20
21#include "qgis_core.h"
22#include "qgsdataprovider.h"
24#include "qgspointcloudindex.h"
26
28class QgsGeometry;
30
42{
43 Q_OBJECT
44 public:
45
50 {
51 NoCapabilities = 0,
52 ReadLayerMetadata = 1 << 0,
53 WriteLayerMetadata = 1 << 1,
54 CreateRenderer = 1 << 2,
55 ContainSubIndexes = 1 << 3,
56 ChangeAttributeValues = 1 << 4,
57 };
58
59 Q_DECLARE_FLAGS( Capabilities, Capability )
60
61
65 {
66 NotIndexed = 0,
67 Indexing = 1 << 0,
68 Indexed = 1 << 1
69 };
70
72 QgsPointCloudDataProvider( const QString &uri,
73 const QgsDataProvider::ProviderOptions &providerOptions,
75
77
78#ifndef SIP_RUN
79
89 QVector<QVariantMap> identify( double maxError, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
90#else
91
101 SIP_PYLIST identify( float maxErrorInMapCoords, QgsGeometry extentGeometry, const QgsDoubleRange extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
102 % MethodCode
103 {
104 QVector<QMap<QString, QVariant>> res = sipCpp->identify( a0, *a1, *a2, a3 );
105 sipRes = PyList_New( res.size() );
106 for ( int i = 0; i < res.size(); ++i )
107 {
108 PyObject *dict = PyDict_New();
109 for ( QString key : res[i].keys() )
110 {
111 PyObject *keyObj = sipConvertFromNewType( new QString( key ), sipType_QString, Py_None );
112 PyObject *valObj = sipConvertFromNewType( new QVariant( res[i][key] ), sipType_QVariant, Py_None );
113 PyDict_SetItem( dict, keyObj, valObj );
114 }
115 PyList_SET_ITEM( sipRes, i, dict );
116 }
117 }
118 % End
119#endif
120
124 virtual QgsPointCloudDataProvider::Capabilities capabilities() const;
125
131
137 virtual void loadIndex( ) = 0;
138
146 virtual void generateIndex( ) = 0;
147
148
153
159 virtual QgsPointCloudIndex index() const { return QgsPointCloudIndex( nullptr ); }
160
169 virtual QVector<QgsPointCloudSubIndex> subIndexes() SIP_SKIP { return QVector<QgsPointCloudSubIndex>(); }
170
179 virtual void loadSubIndex( int n ) SIP_SKIP { Q_UNUSED( n ) return; }
180
184 bool hasValidIndex() const;
185
189 virtual qint64 pointCount() const = 0;
190
202 virtual QgsGeometry polygonBounds() const;
203
210 virtual QVariantMap originalMetadata() const;
211
225 virtual QgsPointCloudRenderer *createRenderer( const QVariantMap &configuration = QVariantMap() ) const SIP_FACTORY;
226
231 QgsPointCloudStatistics metadataStatistics();
232
233 bool supportsSubsetString() const override;
234 QString subsetStringDialect() const override;
235 QString subsetStringHelpUrl() const override;
236 QString subsetString() const override;
237 bool setSubsetString( const QString &subset, bool updateFeatureCount = false ) override;
238
245 static QMap< int, QString > lasClassificationCodes();
246
253 static QMap< int, QString > translatedLasClassificationCodes();
254
260 static QMap< int, QString > dataFormatIds();
261
267 static QMap< int, QString > translatedDataFormatIds();
268
269 signals:
270
274 void indexGenerationStateChanged( QgsPointCloudDataProvider::PointCloudIndexGenerationState state );
275
276 protected:
278 QString mSubsetString;
279
281 QVector<QVariantMap> identify( QgsPointCloudIndex &index, double maxError, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange, int pointsLimit ) SIP_SKIP ;
282
283 private:
284 QVector<QgsPointCloudNodeId> traverseTree( const QgsPointCloudIndex &pc, QgsPointCloudNode node, double maxError, double nodeError, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange );
285
286};
287
288#endif // QGSMESHDATAPROVIDER_H
QFlags< DataProviderReadFlag > DataProviderReadFlags
Flags which control data provider construction.
Definition qgis.h:450
Abstract base class for spatial data provider implementations.
QgsRange which stores a range of double values.
Definition qgsrange.h:237
A geometry is the spatial representation of a feature.
Collection of point cloud attributes.
Base class for providing data for QgsPointCloudLayer.
Capability
Capabilities that providers may implement.
~QgsPointCloudDataProvider() override
virtual QgsPointCloudAttributeCollection attributes() const =0
Returns the attributes available from this data provider.
virtual QVector< QgsPointCloudSubIndex > subIndexes()
Returns a list of sub indexes available if the provider supports multiple indexes,...
virtual void generateIndex()=0
Triggers generation of the point cloud index.
virtual QgsPointCloudIndex index() const
Returns the point cloud index associated with the provider.
virtual void loadSubIndex(int n)
Triggers loading of the point cloud index for the n th sub index.
virtual void loadIndex()=0
Triggers loading of the point cloud index.
virtual qint64 pointCount() const =0
Returns the total number of points available in the dataset.
PointCloudIndexGenerationState
Point cloud index state.
virtual PointCloudIndexGenerationState indexingState()=0
Gets the current index generation state.
Smart pointer for QgsAbstractPointCloudIndex.
Represents a indexed point cloud node's position in octree.
Keeps metadata for indexed point cloud node.
Abstract base class for 2d point cloud renderers.
Class used to store statistics of a point cloud dataset.
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:278
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_FACTORY
Definition qgis_sip.h:76
Setting options for creating vector data providers.