File: qgsfeaturesource.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 (187 lines) | stat: -rw-r--r-- 6,111 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
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsfeaturesource.h                                          *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsFeatureSource
{
%Docstring(signature="appended")
An interface for objects which provide features via a getFeatures
method.
%End

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

    virtual ~QgsFeatureSource();

    virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const = 0;
%Docstring
Returns an iterator for the features in the source. An optional
``request`` can be used to optimise the returned iterator, eg by
restricting the returned attributes or geometry.
%End

    virtual QString sourceName() const = 0;
%Docstring
Returns a friendly display name for the source. The returned value can
be an empty string.
%End

    virtual QgsCoordinateReferenceSystem sourceCrs() const = 0;
%Docstring
Returns the coordinate reference system for features in the source.
%End

    virtual QgsFields fields() const = 0;
%Docstring
Returns the fields associated with features in the source.
%End

    virtual Qgis::WkbType wkbType() const = 0;
%Docstring
Returns the geometry type for features returned by this source.
%End


    Py_ssize_t __len__() const;
%Docstring
Returns the number of features contained in the source, or -1 if the
feature count is unknown.
%End
%MethodCode
    sipRes = sipCpp->featureCount();
%End

    //! Ensures that bool(obj) returns ``True`` (otherwise __len__() would be used)
    int __bool__() const;
%MethodCode
    sipRes = true;
%End

    virtual long long featureCount() const = 0;
%Docstring
Returns the number of features contained in the source, or -1 if the
feature count is unknown.
%End

    virtual Qgis::FeatureAvailability hasFeatures() const;
%Docstring
Determines if there are any features available in the source.

.. versionadded:: 3.2
%End

    virtual QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const;
%Docstring
Returns the set of unique values contained within the specified
``fieldIndex`` from this source. If specified, the ``limit`` option can
be used to limit the number of returned values. The base class
implementation uses a non-optimised approach of looping through all
features in the source.

.. seealso:: :py:func:`minimumValue`

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

    virtual QVariant minimumValue( int fieldIndex ) const;
%Docstring
Returns the minimum value for an attribute column or an invalid variant
in case of error. The base class implementation uses a non-optimised
approach of looping through all features in the source.

.. seealso:: :py:func:`maximumValue`

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

    virtual QVariant maximumValue( int fieldIndex ) const;
%Docstring
Returns the maximum value for an attribute column or an invalid variant
in case of error. The base class implementation uses a non-optimised
approach of looping through all features in the source.

.. seealso:: :py:func:`minimumValue`

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

    virtual QgsRectangle sourceExtent() const;
%Docstring
Returns the extent of all geometries from the source. The base class
implementation uses a non-optimised approach of looping through all
features in the source.
%End

    virtual QgsBox3D sourceExtent3D() const;
%Docstring
Returns the 3D extent of all geometries from the source. The base class
implementation uses a non-optimised approach of looping through all
features in the source.

.. versionadded:: 3.36
%End

    virtual QgsFeatureIds allFeatureIds() const;
%Docstring
Returns a list of all feature IDs for features present in the source.
%End

    QgsVectorLayer *materialize( const QgsFeatureRequest &request,
                                 QgsFeedback *feedback = 0 ) /Factory/;
%Docstring
Materializes a ``request`` (query) made against this feature source, by
running it over the source and returning a new memory based vector layer
containing the result. All settings from feature ``request`` will be
honored.

If a subset of attributes has been set for the request, then only those
selected fields will be present in the output layer.

The CRS for the output layer will match the input layer, unless
:py:func:`QgsFeatureRequest.setDestinationCrs()` has been called with a
valid :py:class:`QgsCoordinateReferenceSystem`. In this case the output
layer will match the :py:func:`QgsFeatureRequest.destinationCrs()` CRS.

The returned layer WKB type will match
:py:func:`~QgsFeatureSource.wkbType`, unless the
:py:class:`QgsFeatureRequest`.NoGeometry flag is set on the ``request``.
In that case the returned layer will not be a spatial layer.

An optional ``feedback`` argument can be used to cancel the
materialization before it has fully completed.

The returned value is a new instance and the caller takes responsibility
for its ownership.
%End

    virtual Qgis::SpatialIndexPresence hasSpatialIndex() const;
%Docstring
Returns an enum value representing the presence of a valid spatial index
on the source, if it can be determined.

If QgsFeatureSource.SpatialIndexUnknown is returned then the presence of
an index cannot be determined.

.. versionadded:: 3.10.1
%End
};


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