QGIS API Documentation  master-59fd5e0
QgsSpatialIndex Class Reference

#include <qgsspatialindex.h>

List of all members.

Public Member Functions

 QgsSpatialIndex ()
 constructor - creates R-tree
 ~QgsSpatialIndex ()
 destructor finalizes work with spatial index
bool deleteFeature (QgsFeature &f)
 remove feature from index
bool insertFeature (QgsFeature &f)
 add feature to index
QList< QgsFeatureIdintersects (QgsRectangle rect)
 returns features that intersect the specified rectangle
QList< QgsFeatureIdnearestNeighbor (QgsPoint point, int neighbors)
 returns nearest neighbors (their count is specified by second parameter)

Protected Member Functions

bool featureInfo (QgsFeature &f, SpatialIndex::Region &r, QgsFeatureId &id)
SpatialIndex::Region rectToRegion (QgsRectangle rect)

Private Attributes

SpatialIndex::ISpatialIndex * mRTree
 R-tree containing spatial index.
SpatialIndex::StorageManager::IBuffer * mStorage
 buffer for index data
SpatialIndex::IStorageManager * mStorageManager
 storage manager

Detailed Description

Definition at line 41 of file qgsspatialindex.h.


Constructor & Destructor Documentation

constructor - creates R-tree

Definition at line 51 of file qgsspatialindex.cpp.

destructor finalizes work with spatial index

Definition at line 75 of file qgsspatialindex.cpp.


Member Function Documentation

remove feature from index

Definition at line 133 of file qgsspatialindex.cpp.

References FID_TO_NUMBER.

bool QgsSpatialIndex::featureInfo ( QgsFeature f,
SpatialIndex::Region &  r,
QgsFeatureId id 
) [protected]

returns features that intersect the specified rectangle

Definition at line 144 of file qgsspatialindex.cpp.

Referenced by QgsPointDisplacementRenderer::createDisplacementGroups(), and QgsOverlayAnalyzer::intersectFeature().

QList< QgsFeatureId > QgsSpatialIndex::nearestNeighbor ( QgsPoint  point,
int  neighbors 
)

returns nearest neighbors (their count is specified by second parameter)

Definition at line 156 of file qgsspatialindex.cpp.

References QgsPoint::x(), and QgsPoint::y().


Member Data Documentation

SpatialIndex::ISpatialIndex* QgsSpatialIndex::mRTree [private]

R-tree containing spatial index.

Definition at line 88 of file qgsspatialindex.h.

SpatialIndex::StorageManager::IBuffer* QgsSpatialIndex::mStorage [private]

buffer for index data

Definition at line 85 of file qgsspatialindex.h.

SpatialIndex::IStorageManager* QgsSpatialIndex::mStorageManager [private]

storage manager

Definition at line 82 of file qgsspatialindex.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines