mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
45 lines
934 B
Plaintext
45 lines
934 B
Plaintext
|
|
||
|
class QgsSpatialIndex
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include "qgsspatialindex.h"
|
||
|
%End
|
||
|
|
||
|
public:
|
||
|
|
||
|
/* creation of spatial index */
|
||
|
|
||
|
/** create new spatial index that will be stored in memory */
|
||
|
//static QgsSpatialIndex* createMemoryIndex();
|
||
|
|
||
|
/** create new spatial index that stores its data on disk */
|
||
|
//static QgsSpatialIndex* createDiskIndex(QString fileName);
|
||
|
|
||
|
/** constructor - creates R-tree */
|
||
|
QgsSpatialIndex();
|
||
|
|
||
|
/** destructor finalizes work with spatial index */
|
||
|
~QgsSpatialIndex();
|
||
|
|
||
|
|
||
|
/* operations */
|
||
|
|
||
|
/** add feature to index */
|
||
|
bool insertFeature(QgsFeature& f);
|
||
|
|
||
|
/** remove feature from index */
|
||
|
bool deleteFeature(QgsFeature& f);
|
||
|
|
||
|
|
||
|
/* queries */
|
||
|
|
||
|
/** returns features that intersect the specified rectangle */
|
||
|
QList<int> intersects(QgsRect rect);
|
||
|
|
||
|
/** returns nearest neighbors (their count is specified by second parameter) */
|
||
|
QList<int> nearestNeighbor(QgsPoint point, int neighbors);
|
||
|
|
||
|
|
||
|
};
|
||
|
|