File: qgspointclouddataprovider.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (337 lines) | stat: -rw-r--r-- 10,593 bytes parent folder | download | duplicates (6)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/pointcloud/qgspointclouddataprovider.h                      *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsPointCloudDataProvider: QgsDataProvider
{
%Docstring(signature="appended")
Base class for providing data for :py:class:`QgsPointCloudLayer`

Responsible for reading native point cloud data and returning the
indexed data.

.. note::

   The API is considered EXPERIMENTAL and can be changed without a notice

.. versionadded:: 3.18
%End

%TypeHeaderCode
#include "qgspointclouddataprovider.h"
%End
  public:

    enum Capability /BaseType=IntEnum/
    {
      NoCapabilities,
      ReadLayerMetadata,
      WriteLayerMetadata,
      CreateRenderer,
      ContainSubIndexes,
    };

    typedef QFlags<QgsPointCloudDataProvider::Capability> Capabilities;


    enum PointCloudIndexGenerationState /BaseType=IntEnum/
    {
      NotIndexed,
      Indexing,
      Indexed
    };

    QgsPointCloudDataProvider( const QString &uri,
                               const QgsDataProvider::ProviderOptions &providerOptions,
                               Qgis::DataProviderReadFlags flags = Qgis::DataProviderReadFlags() );
%Docstring
Ctor
%End

    ~QgsPointCloudDataProvider();


    SIP_PYLIST identify( float maxErrorInMapCoords, QgsGeometry extentGeometry, const QgsDoubleRange extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
%Docstring
Returns the list of points of the point cloud according to a zoom level
defined by ``maxError`` (in layer coordinates), an extent ``geometry``
in the 2D plane and a range ``extentZRange`` for z values. The function
will try to limit the number of points returned to ``pointsLimit``
points

.. note::

   this function does not handle elevation properties and you need to
   change elevation coordinates yourself after returning from the function
%End
%MethodCode
    {
      QVector<QMap<QString, QVariant>> res = sipCpp->identify( a0, *a1, *a2, a3 );
      sipRes = PyList_New( res.size() );
      for ( int i = 0; i < res.size(); ++i )
      {
        PyObject *dict = PyDict_New();
        for ( QString key : res[i].keys() )
        {
          PyObject *keyObj = sipConvertFromNewType( new QString( key ), sipType_QString, Py_None );
          PyObject *valObj = sipConvertFromNewType( new QVariant( res[i][key] ), sipType_QVariant, Py_None );
          PyDict_SetItem( dict, keyObj, valObj );
        }
        PyList_SET_ITEM( sipRes, i, dict );
      }
    }
%End

    virtual QgsPointCloudDataProvider::Capabilities capabilities() const;
%Docstring
Returns flags containing the supported capabilities for the data
provider.
%End

    virtual QgsPointCloudAttributeCollection attributes() const = 0;
%Docstring
Returns the attributes available from this data provider. May return
empty collection until
:py:func:`~QgsPointCloudDataProvider.pointCloudIndexLoaded` is emitted
%End

    virtual void loadIndex( ) = 0;
%Docstring
Triggers loading of the point cloud index

.. seealso:: :py:func:`index`
%End

    virtual void generateIndex( ) = 0;
%Docstring
Triggers generation of the point cloud index

emits :py:func:`~QgsPointCloudDataProvider.indexGenerationStateChanged`

.. seealso:: :py:func:`index`
%End


    virtual PointCloudIndexGenerationState indexingState( ) = 0;
%Docstring
Gets the current index generation state
%End




    bool hasValidIndex() const;
%Docstring
Returns whether provider has index which is valid
%End

    virtual qint64 pointCount() const = 0;
%Docstring
Returns the total number of points available in the dataset.
%End

    virtual QgsGeometry polygonBounds() const;
%Docstring
Returns the polygon bounds of the layer. The CRS of the returned
geometry will match the provider's
:py:func:`~QgsPointCloudDataProvider.crs`.

This method will return the best approximation for the actual bounds of
points contained in the dataset available from the provider's metadata.
This may match the bounding box rectangle returned by
:py:func:`~QgsPointCloudDataProvider.extent`, or for some datasets a
"convex hull" style polygon representing a more precise bounds will be
returned.

This method will not attempt to calculate the data bounds, rather it
will return only whatever precomputed bounds are included in the data
source's metadata.
%End

    virtual QVariantMap originalMetadata() const;
%Docstring
Returns a representation of the original metadata included in a point
cloud dataset.

This is a free-form dictionary of values, the contents and structure of
which will vary by provider and dataset.
%End

    virtual QgsPointCloudRenderer *createRenderer( const QVariantMap &configuration = QVariantMap() ) const /Factory/;
%Docstring
Creates a new 2D point cloud renderer, using provider backend specific
information.

The ``configuration`` map can be used to pass provider-specific
configuration maps to the provider to allow customization of the
returned renderer. Support and format of ``configuration`` varies by
provider.

When called with an empty ``configuration`` map the provider's default
renderer will be returned.

This method returns a new renderer and the caller takes ownership of the
returned object.

Only providers which report the CreateRenderer capability will return a
2D renderer. Other providers will return ``None``.
%End

    virtual bool hasStatisticsMetadata() const;
%Docstring
Returns whether the dataset contains statistics metadata

.. versionadded:: 3.26
%End


    SIP_PYOBJECT metadataStatistic( const QString &attribute, Qgis::Statistic statistic ) const;
%Docstring
Returns a statistic for the specified ``attribute``, taken only from the
metadata of the point cloud data source.

This method will not perform any statistical calculations, rather it
will return only precomputed attribute statistics which are included in
the data source's metadata. Not all data sources include this
information in the metadata, and even for sources with statistical
metadata only some ``statistic`` values may be available.

:raises ValueError: if no matching precalculated statistic is available
                    for the attribute.
%End
%MethodCode
    {
      const QVariant res = sipCpp->metadataStatistic( *a0, a1 );
      if ( !res.isValid() )
      {
        PyErr_SetString( PyExc_ValueError, QStringLiteral( "Statistic is not available" ).toUtf8().constData() );
        sipIsErr = 1;
      }
      else
      {
        QVariant *v = new QVariant( res );
        sipRes = sipConvertFromNewType( v, sipType_QVariant, Py_None );
      }
    }
%End

    virtual QVariantList metadataClasses( const QString &attribute ) const;
%Docstring
Returns a list of existing classes which are present for the specified
``attribute``, taken only from the metadata of the point cloud data
source.

This method will not perform any classification or scan for available
classes, rather it will return only precomputed classes which are
included in the data source's metadata. Not all data sources include
this information in the metadata.
%End



    SIP_PYOBJECT metadataClassStatistic( const QString &attribute, const QVariant &value, Qgis::Statistic statistic ) const;
%Docstring
Returns a statistic for one class ``value`` from the specified
``attribute``, taken only from the metadata of the point cloud data
source. This method will not perform any statistical calculations,
rather it will return only precomputed class statistics which are
included in the data source's metadata. Not all data sources include
this information in the metadata, and even for sources with statistical
metadata only some ``statistic`` values may be available.

:raises ValueError: if no matching precalculated statistic is available
                    for the attribute.
%End
%MethodCode
    {
      const QVariant res = sipCpp->metadataClassStatistic( *a0, *a1, a2 );
      if ( !res.isValid() )
      {
        PyErr_SetString( PyExc_ValueError, QStringLiteral( "Statistic is not available" ).toUtf8().constData() );
        sipIsErr = 1;
      }
      else
      {
        QVariant *v = new QVariant( res );
        sipRes = sipConvertFromNewType( v, sipType_QVariant, Py_None );
      }
    }
%End


    QgsPointCloudStatistics metadataStatistics();
%Docstring
Returns the object containing the statistics metadata extracted from the
dataset

.. versionadded:: 3.26
%End

    virtual bool supportsSubsetString() const;

    virtual QString subsetStringDialect() const;

    virtual QString subsetStringHelpUrl() const;

    virtual QString subsetString() const;

    virtual bool setSubsetString( const QString &subset, bool updateFeatureCount = false );


    static QMap< int, QString > lasClassificationCodes();
%Docstring
Returns the map of LAS classification code to untranslated string value,
corresponding to the ASPRS Standard Lidar Point Classes.

.. seealso:: :py:func:`translatedLasClassificationCodes`
%End

    static QMap< int, QString > translatedLasClassificationCodes();
%Docstring
Returns the map of LAS classification code to translated string value,
corresponding to the ASPRS Standard Lidar Point Classes.

.. seealso:: :py:func:`lasClassificationCodes`
%End

    static QMap< int, QString > dataFormatIds();
%Docstring
Returns the map of LAS data format ID to untranslated string value.

.. seealso:: :py:func:`translatedDataFormatIds`
%End

    static QMap< int, QString > translatedDataFormatIds();
%Docstring
Returns the map of LAS data format ID to translated string value.

.. seealso:: :py:func:`dataFormatIds`
%End

  signals:

    void indexGenerationStateChanged( QgsPointCloudDataProvider::PointCloudIndexGenerationState state );
%Docstring
Emitted when point cloud generation state is changed
%End

  protected:


};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/pointcloud/qgspointclouddataprovider.h                      *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/