QGIS API Documentation 3.41.0-Master (cea29feecf2)
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 };
57
58 Q_DECLARE_FLAGS( Capabilities, Capability )
59
60
64 {
65 NotIndexed = 0,
66 Indexing = 1 << 0,
67 Indexed = 1 << 1
68 };
69
71 QgsPointCloudDataProvider( const QString &uri,
72 const QgsDataProvider::ProviderOptions &providerOptions,
74
76
77#ifndef SIP_RUN
78
88 QVector<QVariantMap> identify( double maxError, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
89#else
90
100 SIP_PYLIST identify( float maxErrorInMapCoords, QgsGeometry extentGeometry, const QgsDoubleRange extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
101 % MethodCode
102 {
103 QVector<QMap<QString, QVariant>> res = sipCpp->identify( a0, *a1, *a2, a3 );
104 sipRes = PyList_New( res.size() );
105 for ( int i = 0; i < res.size(); ++i )
106 {
107 PyObject *dict = PyDict_New();
108 for ( QString key : res[i].keys() )
109 {
110 PyObject *keyObj = sipConvertFromNewType( new QString( key ), sipType_QString, Py_None );
111 PyObject *valObj = sipConvertFromNewType( new QVariant( res[i][key] ), sipType_QVariant, Py_None );
112 PyDict_SetItem( dict, keyObj, valObj );
113 }
114 PyList_SET_ITEM( sipRes, i, dict );
115 }
116 }
117 % End
118#endif
119
123 virtual QgsPointCloudDataProvider::Capabilities capabilities() const;
124
130
136 virtual void loadIndex( ) = 0;
137
145 virtual void generateIndex( ) = 0;
146
147
152
160 virtual QgsPointCloudIndex *index() const SIP_SKIP {return nullptr;}
161
170 virtual QVector<QgsPointCloudSubIndex> subIndexes() SIP_SKIP { return QVector<QgsPointCloudSubIndex>(); }
171
180 virtual void loadSubIndex( int n ) SIP_SKIP { Q_UNUSED( n ) return; }
181
185 bool hasValidIndex() const;
186
190 virtual qint64 pointCount() const = 0;
191
203 virtual QgsGeometry polygonBounds() const;
204
211 virtual QVariantMap originalMetadata() const;
212
226 virtual QgsPointCloudRenderer *createRenderer( const QVariantMap &configuration = QVariantMap() ) const SIP_FACTORY;
227
232 QgsPointCloudStatistics metadataStatistics();
233
234 bool supportsSubsetString() const override;
235 QString subsetStringDialect() const override;
236 QString subsetStringHelpUrl() const override;
237 QString subsetString() const override;
238 bool setSubsetString( const QString &subset, bool updateFeatureCount = false ) override;
239
246 static QMap< int, QString > lasClassificationCodes();
247
254 static QMap< int, QString > translatedLasClassificationCodes();
255
261 static QMap< int, QString > dataFormatIds();
262
268 static QMap< int, QString > translatedDataFormatIds();
269
270 signals:
271
275 void indexGenerationStateChanged( QgsPointCloudDataProvider::PointCloudIndexGenerationState state );
276
277 protected:
279 QString mSubsetString;
280
282 QVector<QVariantMap> identify( QgsPointCloudIndex *index, double maxError, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange, int pointsLimit ) SIP_SKIP ;
283
284 private:
285 QVector<QgsPointCloudNodeId> traverseTree( const QgsPointCloudIndex *pc, QgsPointCloudNode node, double maxError, double nodeError, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange );
286
287};
288
289#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:231
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 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 QgsPointCloudIndex * index() const
Returns the point cloud index associated with the provider.
virtual PointCloudIndexGenerationState indexingState()=0
Gets the current index generation state.
Represents a indexed point clouds data in octree.
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.