QGIS API Documentation  2.12.0-Lyon
Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
QgsPointLocator Class Reference

The class defines interface for querying point location: More...

#include <qgspointlocator.h>

Inheritance diagram for QgsPointLocator:
Inheritance graph
[legend]

Classes

struct  Match
 
struct  MatchFilter
 Interface that allows rejection of some matches in intersection queries (e.g. More...
 

Public Types

typedef class QList< MatchMatchList
 
enum  Type {
  Invalid = 0, Vertex = 1, Edge = 2, Area = 4,
  All = Vertex | Edge | Area
}
 

Public Member Functions

 QgsPointLocator (QgsVectorLayer *layer, const QgsCoordinateReferenceSystem *destCRS=0, const QgsRectangle *extent=0)
 Construct point locator for a layer. More...
 
 ~QgsPointLocator ()
 
MatchList edgesInRect (const QgsRectangle &rect, MatchFilter *filter=0)
 Find edges within a specified recangle Optional filter may discard unwanted matches. More...
 
MatchList edgesInRect (const QgsPoint &point, double tolerance, MatchFilter *filter=0)
 Override of edgesInRect that construct rectangle from a center point and tolerance. More...
 
bool hasIndex () const
 Indicate whether the data have been already indexed. More...
 
bool init (int maxFeaturesToIndex=-1)
 Prepare the index for queries. More...
 
Match nearestEdge (const QgsPoint &point, double tolerance, MatchFilter *filter=0)
 Find nearest edges to the specified point - up to distance specified by tolerance Optional filter may discard unwanted matches. More...
 
Match nearestVertex (const QgsPoint &point, double tolerance, MatchFilter *filter=0)
 Find nearest vertex to the specified point - up to distance specified by tolerance Optional filter may discard unwanted matches. More...
 
MatchList pointInPolygon (const QgsPoint &point)
 find out if the point is in any polygons More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Protected Member Functions

void destroyIndex ()
 
bool rebuildIndex (int maxFeaturesToIndex=-1)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Friends

class QgsPointLocator_VisitorArea
 
class QgsPointLocator_VisitorEdgesInRect
 
class QgsPointLocator_VisitorNearestEdge
 
class QgsPointLocator_VisitorNearestVertex
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The class defines interface for querying point location:

Works with one layer.

Note
added in 2.8

Definition at line 48 of file qgspointlocator.h.

Member Typedef Documentation

Definition at line 135 of file qgspointlocator.h.

Member Enumeration Documentation

Enumerator
Invalid 
Vertex 
Edge 
Area 
All 

Definition at line 60 of file qgspointlocator.h.

Constructor & Destructor Documentation

QgsPointLocator::QgsPointLocator ( QgsVectorLayer layer,
const QgsCoordinateReferenceSystem destCRS = 0,
const QgsRectangle extent = 0 
)
explicit

Construct point locator for a layer.

  • destCRS if not null, will do the searches on data reprojected to the given CRS
  • extent if not null, will index only a subset of the layer

Definition at line 574 of file qgspointlocator.cpp.

QgsPointLocator::~QgsPointLocator ( )

Definition at line 600 of file qgspointlocator.cpp.

Member Function Documentation

void QgsPointLocator::destroyIndex ( )
protected

Definition at line 708 of file qgspointlocator.cpp.

QgsPointLocator::MatchList QgsPointLocator::edgesInRect ( const QgsRectangle rect,
QgsPointLocator::MatchFilter filter = 0 
)

Find edges within a specified recangle Optional filter may discard unwanted matches.

Definition at line 818 of file qgspointlocator.cpp.

QgsPointLocator::MatchList QgsPointLocator::edgesInRect ( const QgsPoint point,
double  tolerance,
QgsPointLocator::MatchFilter filter = 0 
)

Override of edgesInRect that construct rectangle from a center point and tolerance.

Definition at line 834 of file qgspointlocator.cpp.

bool QgsPointLocator::hasIndex ( ) const

Indicate whether the data have been already indexed.

Definition at line 614 of file qgspointlocator.cpp.

bool QgsPointLocator::init ( int  maxFeaturesToIndex = -1)

Prepare the index for queries.

Does nothing if the index already exists. If the number of features is greater than the value of maxFeaturesToIndex, creation of index is stopped to make sure we do not run out of memory. If maxFeaturesToIndex is -1, no limits are used. Returns false if the creation of index has been prematurely stopped due to the limit of features, otherwise true

Definition at line 609 of file qgspointlocator.cpp.

QgsPointLocator::Match QgsPointLocator::nearestEdge ( const QgsPoint point,
double  tolerance,
MatchFilter filter = 0 
)

Find nearest edges to the specified point - up to distance specified by tolerance Optional filter may discard unwanted matches.

Definition at line 800 of file qgspointlocator.cpp.

QgsPointLocator::Match QgsPointLocator::nearestVertex ( const QgsPoint point,
double  tolerance,
MatchFilter filter = 0 
)

Find nearest vertex to the specified point - up to distance specified by tolerance Optional filter may discard unwanted matches.

Definition at line 782 of file qgspointlocator.cpp.

QgsPointLocator::MatchList QgsPointLocator::pointInPolygon ( const QgsPoint point)

find out if the point is in any polygons

Definition at line 841 of file qgspointlocator.cpp.

bool QgsPointLocator::rebuildIndex ( int  maxFeaturesToIndex = -1)
protected

Definition at line 621 of file qgspointlocator.cpp.

Friends And Related Function Documentation

friend class QgsPointLocator_VisitorArea
friend

Definition at line 192 of file qgspointlocator.h.

Definition at line 193 of file qgspointlocator.h.

Definition at line 191 of file qgspointlocator.h.

Definition at line 190 of file qgspointlocator.h.


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