QGIS API Documentation
3.6.0-Noosa (5873452)
|
A very fast static spatial index for 2D points based on a flat KD-tree. More...
#include <qgsspatialindexkdbush.h>
Public Member Functions | |
QgsSpatialIndexKDBush (QgsFeatureIterator &fi, QgsFeedback *feedback=nullptr) | |
Constructor - creates KDBush index and bulk loads it with features from the iterator. More... | |
QgsSpatialIndexKDBush (const QgsFeatureSource &source, QgsFeedback *feedback=nullptr) | |
Constructor - creates KDBush index and bulk loads it with features from the source. More... | |
QgsSpatialIndexKDBush (const QgsSpatialIndexKDBush &other) | |
Copy constructor. More... | |
~QgsSpatialIndexKDBush () | |
QList< QgsSpatialIndexKDBushData > | intersects (const QgsRectangle &rectangle) const |
Returns the list of features which fall within the specified rectangle. More... | |
void | intersects (const QgsRectangle &rectangle, const std::function< void(QgsSpatialIndexKDBushData)> &visitor) const |
Calls a visitor function for all features which fall within the specified rectangle. More... | |
QgsSpatialIndexKDBush & | operator= (const QgsSpatialIndexKDBush &other) |
Assignment operator. More... | |
qgssize | size () const |
Returns the size of the index, i.e. More... | |
QList< QgsSpatialIndexKDBushData > | within (const QgsPointXY &point, double radius) const |
Returns the list of features which are within the given search radius of point. More... | |
void | within (const QgsPointXY &point, double radius, const std::function< void(QgsSpatialIndexKDBushData)> &visitor) |
Calls a visitor function for all features which are within the given search radius of point. More... | |
Friends | |
class | TestQgsSpatialIndexKdBush |
A very fast static spatial index for 2D points based on a flat KD-tree.
Compared to QgsSpatialIndex, this index:
QgsSpatialIndexKDBush objects are implicitly shared and can be inexpensively copied.
Definition at line 53 of file qgsspatialindexkdbush.h.
|
explicit |
Constructor - creates KDBush index and bulk loads it with features from the iterator.
The optional feedback object can be used to allow cancelation 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.
Definition at line 24 of file qgsspatialindexkdbush.cpp.
|
explicit |
Constructor - creates KDBush index and bulk loads it with features from the source.
The optional feedback object can be used to allow cancelation 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.
Definition at line 30 of file qgsspatialindexkdbush.cpp.
QgsSpatialIndexKDBush::QgsSpatialIndexKDBush | ( | const QgsSpatialIndexKDBush & | other | ) |
Copy constructor.
Definition at line 35 of file qgsspatialindexkdbush.cpp.
QgsSpatialIndexKDBush::~QgsSpatialIndexKDBush | ( | ) |
Definition at line 53 of file qgsspatialindexkdbush.cpp.
QList< QgsSpatialIndexKDBushData > QgsSpatialIndexKDBush::intersects | ( | const QgsRectangle & | rectangle | ) | const |
Returns the list of features which fall within the specified rectangle.
Definition at line 76 of file qgsspatialindexkdbush.cpp.
void QgsSpatialIndexKDBush::intersects | ( | const QgsRectangle & | rectangle, |
const std::function< void(QgsSpatialIndexKDBushData)> & | visitor | ||
) | const |
Calls a visitor function for all features which fall within the specified rectangle.
Definition at line 86 of file qgsspatialindexkdbush.cpp.
QgsSpatialIndexKDBush & QgsSpatialIndexKDBush::operator= | ( | const QgsSpatialIndexKDBush & | other | ) |
Assignment operator.
Definition at line 41 of file qgsspatialindexkdbush.cpp.
qgssize QgsSpatialIndexKDBush::size | ( | ) | const |
Returns the size of the index, i.e.
the number of points contained within the index.
Definition at line 71 of file qgsspatialindexkdbush.cpp.
QList< QgsSpatialIndexKDBushData > QgsSpatialIndexKDBush::within | ( | const QgsPointXY & | point, |
double | radius | ||
) | const |
Returns the list of features which are within the given search radius of point.
Definition at line 59 of file qgsspatialindexkdbush.cpp.
void QgsSpatialIndexKDBush::within | ( | const QgsPointXY & | point, |
double | radius, | ||
const std::function< void(QgsSpatialIndexKDBushData)> & | visitor | ||
) |
Calls a visitor function for all features which are within the given search radius of point.
Definition at line 66 of file qgsspatialindexkdbush.cpp.
|
friend |
Definition at line 123 of file qgsspatialindexkdbush.h.