QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
#include <qgsspatialindex.h>
Public Member Functions | |
QgsSpatialIndex () | |
Constructor - creates R-tree. More... | |
QgsSpatialIndex (const QgsFeatureIterator &fi) | |
Constructor - creates R-tree and bulk loads it with features from the iterator. More... | |
QgsSpatialIndex (const QgsSpatialIndex &other) | |
Copy constructor. More... | |
~QgsSpatialIndex () | |
Destructor finalizes work with spatial index. More... | |
bool | deleteFeature (const QgsFeature &f) |
Remove feature from index. More... | |
bool | insertFeature (const QgsFeature &f) |
Add feature to index. More... | |
QList< QgsFeatureId > | intersects (const QgsRectangle &rect) const |
Returns features that intersect the specified rectangle. More... | |
QList< QgsFeatureId > | nearestNeighbor (const QgsPoint &point, int neighbors) const |
Returns nearest neighbors (their count is specified by second parameter) More... | |
QgsSpatialIndex & | operator= (const QgsSpatialIndex &other) |
Implement assignment operator. More... | |
QAtomicInt | refs () const |
get reference count - just for debugging! More... | |
Static Protected Member Functions | |
static bool | featureInfo (const QgsFeature &f, SpatialIndex::Region &r, QgsFeatureId &id) |
static SpatialIndex::Region | rectToRegion (const QgsRectangle &rect) |
Friends | |
class | QgsFeatureIteratorDataStream |
Definition at line 48 of file qgsspatialindex.h.
QgsSpatialIndex::QgsSpatialIndex | ( | ) |
Constructor - creates R-tree.
Definition at line 221 of file qgsspatialindex.cpp.
|
explicit |
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.
Definition at line 226 of file qgsspatialindex.cpp.
QgsSpatialIndex::QgsSpatialIndex | ( | const QgsSpatialIndex & | other | ) |
Copy constructor.
Definition at line 231 of file qgsspatialindex.cpp.
QgsSpatialIndex::~QgsSpatialIndex | ( | ) |
Destructor finalizes work with spatial index.
Definition at line 236 of file qgsspatialindex.cpp.
bool QgsSpatialIndex::deleteFeature | ( | const QgsFeature & | f | ) |
Remove feature from index.
Definition at line 298 of file qgsspatialindex.cpp.
|
staticprotected |
Definition at line 254 of file qgsspatialindex.cpp.
bool QgsSpatialIndex::insertFeature | ( | const QgsFeature & | f | ) |
Add feature to index.
Definition at line 267 of file qgsspatialindex.cpp.
QList< QgsFeatureId > QgsSpatialIndex::intersects | ( | const QgsRectangle & | rect | ) | const |
Returns features that intersect the specified rectangle.
Definition at line 309 of file qgsspatialindex.cpp.
QList< QgsFeatureId > QgsSpatialIndex::nearestNeighbor | ( | const QgsPoint & | point, |
int | neighbors | ||
) | const |
Returns nearest neighbors (their count is specified by second parameter)
Definition at line 321 of file qgsspatialindex.cpp.
QgsSpatialIndex & QgsSpatialIndex::operator= | ( | const QgsSpatialIndex & | other | ) |
Implement assignment operator.
Definition at line 240 of file qgsspatialindex.cpp.
|
staticprotected |
Definition at line 247 of file qgsspatialindex.cpp.
QAtomicInt QgsSpatialIndex::refs | ( | ) | const |
get reference count - just for debugging!
Definition at line 334 of file qgsspatialindex.cpp.
|
friend |
Definition at line 102 of file qgsspatialindex.h.