QGIS/python/core/qgsspatialindex.sip

61 lines
1.6 KiB
Plaintext
Raw Normal View History

class QgsSpatialIndex
{
%TypeHeaderCode
#include "qgsspatialindex.h"
%End
public:
/* creation of spatial index */
2015-07-29 11:52:14 +02:00
/** Constructor - creates R-tree */
QgsSpatialIndex();
2015-07-29 11:52:14 +02:00
/** 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 );
2015-07-29 11:52:14 +02:00
/** Copy constructor */
QgsSpatialIndex( const QgsSpatialIndex &other );
2015-07-29 11:52:14 +02:00
/** Destructor finalizes work with spatial index */
~QgsSpatialIndex();
2015-07-29 11:52:14 +02:00
/** Implement assignment operator */
// QgsSpatialIndex &operator=( const QgsSpatialIndex &other );
/* operations */
2015-07-29 11:52:14 +02:00
/** Add feature to index */
bool insertFeature( const QgsFeature &f );
2015-07-29 11:52:14 +02:00
/** Remove feature from index */
bool deleteFeature( const QgsFeature &f );
/* queries */
2015-07-29 11:52:14 +02:00
/** Returns features that intersect the specified rectangle */
QList<qint64> intersects( const QgsRectangle &rect ) const;
2015-07-29 11:52:14 +02:00
/** Returns nearest neighbors (their count is specified by second parameter) */
QList<qint64> nearestNeighbor( const QgsPoint &point, int neighbors ) const;
2014-05-27 23:22:50 +02:00
/* debugging */
//! get reference count - just for debugging!
int refs() const;
protected:
2014-05-27 23:22:50 +02:00
// @note not available in python bindings
// static SpatialIndex::Region rectToRegion( const QgsRectangle &rect );
2014-05-27 23:22:50 +02:00
// @note not available in python bindings
// bool featureInfo( const QgsFeature &f, SpatialIndex::Region &r, QgsFeatureId &id );
};