QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Protected Member Functions | Friends | List of all members
QgsSpatialIndex Class Reference

#include <qgsspatialindex.h>

Public Member Functions

 QgsSpatialIndex ()
 constructor - creates R-tree
 QgsSpatialIndex (const QgsFeatureIterator &fi)
 constructor - creates R-tree and bulk loads it with features from the iterator.
 QgsSpatialIndex (const QgsSpatialIndex &other)
 copy constructor
 ~QgsSpatialIndex ()
 destructor finalizes work with spatial index
bool deleteFeature (const QgsFeature &f)
 remove feature from index
bool insertFeature (const QgsFeature &f)
 add feature to index
QList< QgsFeatureIdintersects (QgsRectangle rect) const
 returns features that intersect the specified rectangle
QList< QgsFeatureIdnearestNeighbor (QgsPoint point, int neighbors) const
 returns nearest neighbors (their count is specified by second parameter)
QgsSpatialIndexoperator= (const QgsSpatialIndex &other)
 implement assignment operator
QAtomicInt refs () const
 get reference count - just for debugging!

Static Protected Member Functions

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

Friends

class QgsFeatureIteratorDataStream

Detailed Description

Definition at line 45 of file qgsspatialindex.h.

Constructor & Destructor Documentation

QgsSpatialIndex::QgsSpatialIndex ( )

constructor - creates R-tree

Definition at line 199 of file qgsspatialindex.cpp.

QgsSpatialIndex::QgsSpatialIndex ( const QgsFeatureIterator fi)
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.

Note
added in 2.8

Definition at line 204 of file qgsspatialindex.cpp.

QgsSpatialIndex::QgsSpatialIndex ( const QgsSpatialIndex other)

copy constructor

Definition at line 209 of file qgsspatialindex.cpp.

QgsSpatialIndex::~QgsSpatialIndex ( )

destructor finalizes work with spatial index

Definition at line 214 of file qgsspatialindex.cpp.

Member Function Documentation

bool QgsSpatialIndex::deleteFeature ( const QgsFeature f)

remove feature from index

Definition at line 278 of file qgsspatialindex.cpp.

bool QgsSpatialIndex::featureInfo ( const QgsFeature f,
SpatialIndex::Region &  r,
QgsFeatureId id 
)
staticprotected

Definition at line 235 of file qgsspatialindex.cpp.

bool QgsSpatialIndex::insertFeature ( const QgsFeature f)

add feature to index

Definition at line 247 of file qgsspatialindex.cpp.

QList< QgsFeatureId > QgsSpatialIndex::intersects ( QgsRectangle  rect) const

returns features that intersect the specified rectangle

Definition at line 289 of file qgsspatialindex.cpp.

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

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

Definition at line 301 of file qgsspatialindex.cpp.

QgsSpatialIndex & QgsSpatialIndex::operator= ( const QgsSpatialIndex other)

implement assignment operator

Definition at line 218 of file qgsspatialindex.cpp.

Region QgsSpatialIndex::rectToRegion ( QgsRectangle  rect)
staticprotected

Definition at line 225 of file qgsspatialindex.cpp.

QAtomicInt QgsSpatialIndex::refs ( ) const

get reference count - just for debugging!

Definition at line 316 of file qgsspatialindex.cpp.

Friends And Related Function Documentation

friend class QgsFeatureIteratorDataStream
friend

Definition at line 99 of file qgsspatialindex.h.


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