Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
QgsSpatialIndex Class Reference

#include <qgsspatialindex.h>

Public Member Functions

 QgsSpatialIndex ()
 create new spatial index that will be stored in memory More...
 
 ~QgsSpatialIndex ()
 destructor finalizes work with spatial index More...
 
bool insertFeature (QgsFeature &f)
 add feature to index More...
 
bool deleteFeature (QgsFeature &f)
 remove feature from index More...
 
QList< int > intersects (QgsRectangle rect)
 returns features that intersect the specified rectangle More...
 
QList< int > nearestNeighbor (QgsPoint point, int neighbors)
 returns nearest neighbors (their count is specified by second parameter) More...
 

Protected Member Functions

Tools::Geometry::Region rectToRegion (QgsRectangle rect)
 
bool featureInfo (QgsFeature &f, Tools::Geometry::Region &r, long &id)
 

Private Attributes

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

Detailed Description

Definition at line 45 of file qgsspatialindex.h.

Constructor & Destructor Documentation

QgsSpatialIndex::QgsSpatialIndex ( )

create new spatial index that will be stored in memory

create new spatial index that stores its data on disk constructor - creates R-tree

Definition at line 50 of file qgsspatialindex.cpp.

QgsSpatialIndex::~QgsSpatialIndex ( )

destructor finalizes work with spatial index

Definition at line 74 of file qgsspatialindex.cpp.

Member Function Documentation

bool QgsSpatialIndex::deleteFeature ( QgsFeature f)

remove feature from index

Definition at line 132 of file qgsspatialindex.cpp.

bool QgsSpatialIndex::featureInfo ( QgsFeature f,
Tools::Geometry::Region &  r,
long &  id 
)
protected
bool QgsSpatialIndex::insertFeature ( QgsFeature f)

add feature to index

Definition at line 102 of file qgsspatialindex.cpp.

References QgsDebugMsg.

Referenced by QgsOverlayAnalyzer::intersection().

QList< int > QgsSpatialIndex::intersects ( QgsRectangle  rect)

returns features that intersect the specified rectangle

Definition at line 143 of file qgsspatialindex.cpp.

Referenced by QgsOverlayAnalyzer::intersectFeature().

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

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

Definition at line 155 of file qgsspatialindex.cpp.

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

Tools::Geometry::Region QgsSpatialIndex::rectToRegion ( QgsRectangle  rect)
protected

Member Data Documentation

SpatialIndex::ISpatialIndex* QgsSpatialIndex::mRTree
private

R-tree containing spatial index.

Definition at line 99 of file qgsspatialindex.h.

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

buffer for index data

Definition at line 96 of file qgsspatialindex.h.

SpatialIndex::IStorageManager* QgsSpatialIndex::mStorageManager
private

storage manager

Definition at line 93 of file qgsspatialindex.h.


The documentation for this class was generated from the following files: