/
qgsspatialindex.sip
60 lines (40 loc) · 1.58 KB
/
qgsspatialindex.sip
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
class QgsSpatialIndex
{
%TypeHeaderCode
#include "qgsspatialindex.h"
%End
public:
/* creation of spatial index */
/** constructor - creates R-tree */
QgsSpatialIndex();
/** constructor - creates R-tree and bulk loads it with features from the iterator.
* This is much faster approach than creating an empty index and then inserting features one by one.
*
* @note added in 2.8
*/
explicit QgsSpatialIndex( const QgsFeatureIterator& fi );
/** copy constructor */
QgsSpatialIndex( const QgsSpatialIndex& other );
/** destructor finalizes work with spatial index */
~QgsSpatialIndex();
/** implement assignment operator */
// QgsSpatialIndex& operator=( const QgsSpatialIndex& other );
/* operations */
/** add feature to index */
bool insertFeature( const QgsFeature& f );
/** remove feature from index */
bool deleteFeature( const QgsFeature& f );
/* queries */
/** returns features that intersect the specified rectangle */
QList<qint64> intersects( QgsRectangle rect ) const;
/** returns nearest neighbors (their count is specified by second parameter) */
QList<qint64> nearestNeighbor( QgsPoint point, int neighbors ) const;
/* debugging */
//! get reference count - just for debugging!
int refs() const;
protected:
// @note not available in python bindings
// static SpatialIndex::Region rectToRegion( QgsRectangle rect );
// @note not available in python bindings
// bool featureInfo( const QgsFeature& f, SpatialIndex::Region& r, QgsFeatureId &id );
};