QGIS API Documentation
2.4.0-Chugiak
|
#include <qgsspatialindex.h>
Public Member Functions | |
QgsSpatialIndex () | |
constructor - creates R-tree More... | |
QgsSpatialIndex (const QgsSpatialIndex &other) | |
copy constructor More... | |
~QgsSpatialIndex () | |
destructor finalizes work with spatial index More... | |
QgsSpatialIndex & | operator= (const QgsSpatialIndex &other) |
implement assignment operator More... | |
bool | insertFeature (const QgsFeature &f) |
add feature to index More... | |
bool | deleteFeature (const QgsFeature &f) |
remove feature from index More... | |
QList< QgsFeatureId > | intersects (QgsRectangle rect) const |
returns features that intersect the specified rectangle More... | |
QList< QgsFeatureId > | nearestNeighbor (QgsPoint point, int neighbors) const |
returns nearest neighbors (their count is specified by second parameter) More... | |
int | refs () const |
get reference count - just for debugging! More... | |
Protected Member Functions | |
bool | featureInfo (const QgsFeature &f, SpatialIndex::Region &r, QgsFeatureId &id) |
Static Protected Member Functions | |
static SpatialIndex::Region | rectToRegion (QgsRectangle rect) |
Private Attributes | |
QSharedDataPointer < QgsSpatialIndexData > | d |
Definition at line 44 of file qgsspatialindex.h.
QgsSpatialIndex::QgsSpatialIndex | ( | ) |
constructor - creates R-tree
Definition at line 132 of file qgsspatialindex.cpp.
QgsSpatialIndex::QgsSpatialIndex | ( | const QgsSpatialIndex & | other | ) |
copy constructor
Definition at line 137 of file qgsspatialindex.cpp.
QgsSpatialIndex::~QgsSpatialIndex | ( | ) |
destructor finalizes work with spatial index
Definition at line 142 of file qgsspatialindex.cpp.
bool QgsSpatialIndex::deleteFeature | ( | const QgsFeature & | f | ) |
remove feature from index
Definition at line 206 of file qgsspatialindex.cpp.
References d, featureInfo(), and FID_TO_NUMBER.
|
protected |
Definition at line 163 of file qgsspatialindex.cpp.
References QgsGeometry::boundingBox(), QgsFeature::geometry(), QgsFeature::id(), and rectToRegion().
Referenced by deleteFeature(), and insertFeature().
bool QgsSpatialIndex::insertFeature | ( | const QgsFeature & | f | ) |
add feature to index
Definition at line 175 of file qgsspatialindex.cpp.
References d, featureInfo(), FID_TO_NUMBER, and QgsDebugMsg.
Referenced by QgsPointSample::addSamplePoints(), QgsTransectSample::createSample(), QgsOverlayAnalyzer::intersection(), and QgsPointDisplacementRenderer::renderFeature().
QList< QgsFeatureId > QgsSpatialIndex::intersects | ( | QgsRectangle | rect | ) | const |
returns features that intersect the specified rectangle
Definition at line 217 of file qgsspatialindex.cpp.
References d, and rectToRegion().
Referenced by QgsOverlayAnalyzer::intersectFeature(), QgsTransectSample::otherTransectWithinDistance(), and QgsPointDisplacementRenderer::renderFeature().
QList< QgsFeatureId > QgsSpatialIndex::nearestNeighbor | ( | QgsPoint | point, |
int | neighbors | ||
) | const |
returns nearest neighbors (their count is specified by second parameter)
Definition at line 229 of file qgsspatialindex.cpp.
References d, QgsPoint::x(), and QgsPoint::y().
Referenced by QgsPointSample::checkMinDistance().
QgsSpatialIndex & QgsSpatialIndex::operator= | ( | const QgsSpatialIndex & | other | ) |
|
staticprotected |
Definition at line 153 of file qgsspatialindex.cpp.
References QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by featureInfo(), and intersects().
int QgsSpatialIndex::refs | ( | ) | const |
get reference count - just for debugging!
Definition at line 244 of file qgsspatialindex.cpp.
References d.
|
private |
Definition at line 93 of file qgsspatialindex.h.
Referenced by deleteFeature(), insertFeature(), intersects(), nearestNeighbor(), operator=(), and refs().