File: qgsspatialindexkdbush.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 (103 lines) | stat: -rw-r--r-- 3,607 bytes parent folder | download | duplicates (14)
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
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsspatialindexkdbush.h                                     *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsSpatialIndexKDBush
{
%Docstring(signature="appended")
A very fast static spatial index for 2D points based on a flat KD-tree.

Compared to :py:class:`QgsSpatialIndex`, this index:

- supports single point features only (no multipoints)
- is static (features cannot be added or removed from the index after
  construction)
- is much faster!
- allows direct retrieval of the original feature's points, without
  requiring additional feature requests
- supports true "distance based" searches, i.e. return all points within
  a radius from a search point

:py:class:`QgsSpatialIndexKDBush` objects are implicitly shared and can
be inexpensively copied.

.. seealso:: :py:class:`QgsSpatialIndex` which is an general, mutable index for geometry bounding boxes.

.. versionadded:: 3.4
%End

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

    explicit QgsSpatialIndexKDBush( QgsFeatureIterator &fi, QgsFeedback *feedback = 0 );
%Docstring
Constructor - creates KDBush index and bulk loads it with features from
the iterator.

The optional ``feedback`` object can be used to allow cancellation of
bulk feature loading. Ownership of ``feedback`` is not transferred, and
callers must take care that the lifetime of feedback exceeds that of the
spatial index construction.

Any non-single point features encountered during iteration will be
ignored and not included in the index.
%End

    explicit QgsSpatialIndexKDBush( const QgsFeatureSource &source, QgsFeedback *feedback = 0 );
%Docstring
Constructor - creates KDBush index and bulk loads it with features from
the source.

The optional ``feedback`` object can be used to allow cancellation of
bulk feature loading. Ownership of ``feedback`` is not transferred, and
callers must take care that the lifetime of feedback exceeds that of the
spatial index construction.

Any non-single point features encountered during iteration will be
ignored and not included in the index.
%End


    QgsSpatialIndexKDBush( const QgsSpatialIndexKDBush &other );

    ~QgsSpatialIndexKDBush();

    QList<QgsSpatialIndexKDBushData> intersects( const QgsRectangle &rectangle ) const;
%Docstring
Returns the list of features which fall within the specified
``rectangle``.
%End


    QList<QgsSpatialIndexKDBushData> within( const QgsPointXY &point, double radius ) const;
%Docstring
Returns the list of features which are within the given search
``radius`` of ``point``.
%End


    qgssize size() const;
%Docstring
Returns the size of the index, i.e. the number of points contained
within the index.
%End

};

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