2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
class QgsSpatialIndex
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsspatialindex.h"
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
public:
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/* creation of spatial index */
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** constructor - creates R-tree */
|
|
|
|
QgsSpatialIndex();
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2013-12-05 18:27:45 +07:00
|
|
|
/** copy constructor */
|
|
|
|
QgsSpatialIndex( const QgsSpatialIndex& other );
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** destructor finalizes work with spatial index */
|
|
|
|
~QgsSpatialIndex();
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2013-12-05 18:27:45 +07:00
|
|
|
/** implement assignment operator */
|
|
|
|
//QgsSpatialIndex& operator=( const QgsSpatialIndex& other );
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/* operations */
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** add feature to index */
|
2013-12-05 18:27:45 +07:00
|
|
|
bool insertFeature( const QgsFeature& f );
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** remove feature from index */
|
2013-12-05 18:27:45 +07:00
|
|
|
bool deleteFeature( const QgsFeature& f );
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/* queries */
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** returns features that intersect the specified rectangle */
|
2013-12-05 18:27:45 +07:00
|
|
|
QList<qint64> intersects( QgsRectangle rect ) const;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
/** returns nearest neighbors (their count is specified by second parameter) */
|
2013-12-05 18:27:45 +07:00
|
|
|
QList<qint64> nearestNeighbor( QgsPoint point, int neighbors ) const;
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
protected:
|
2013-12-05 18:27:45 +07:00
|
|
|
// static SpatialIndex::Region rectToRegion( QgsRectangle rect );
|
2012-09-24 02:28:15 +02:00
|
|
|
// bool featureInfo( QgsFeature& f, SpatialIndex::Region& r, QgsFeatureId &id );
|
2007-01-09 02:39:15 +00:00
|
|
|
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|