QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
The class defines interface for querying point location: More...
#include <qgspointlocator.h>
Classes | |
struct | Match |
struct | MatchFilter |
Interface that allows rejection of some matches in intersection queries (e.g. More... | |
Public Types | |
typedef class QList< Match > | MatchList |
enum | Type { Invalid = 0, Vertex = 1, Edge = 2, Area = 4, All = Vertex | Edge | Area } |
The type of a snap result or the filter type for a snap request. More... | |
Public Member Functions | |
QgsPointLocator (QgsVectorLayer *layer, const QgsCoordinateReferenceSystem *destCRS=nullptr, const QgsRectangle *extent=nullptr) | |
Construct point locator for a layer. More... | |
~QgsPointLocator () | |
int | cachedGeometryCount () const |
Return how many geometries are cached in the index. More... | |
const QgsCoordinateReferenceSystem * | destCRS () const |
Get destination CRS - may be null if not doing OTF reprojection. More... | |
MatchList | edgesInRect (const QgsRectangle &rect, MatchFilter *filter=nullptr) |
Find edges within a specified recangle Optional filter may discard unwanted matches. More... | |
MatchList | edgesInRect (const QgsPoint &point, double tolerance, MatchFilter *filter=nullptr) |
Override of edgesInRect that construct rectangle from a center point and tolerance. More... | |
const QgsRectangle * | extent () const |
Get extent of the area point locator covers - if null then it caches the whole layer. More... | |
bool | hasIndex () const |
Indicate whether the data have been already indexed. More... | |
bool | init (int maxFeaturesToIndex=-1) |
Prepare the index for queries. More... | |
QgsVectorLayer * | layer () const |
Get associated layer. More... | |
Match | nearestEdge (const QgsPoint &point, double tolerance, MatchFilter *filter=nullptr) |
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=nullptr) |
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... | |
void | setExtent (const QgsRectangle *extent) |
Configure extent - if not null, it will index only that area. More... | |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (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< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) 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 QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () 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) |
QThread * | thread () const |
Protected Slots | |
void | destroyIndex () |
Protected Member Functions | |
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 |
QObject * | sender () 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 | |
The class defines interface for querying point location:
Works with one layer.
Definition at line 50 of file qgspointlocator.h.
typedef class QList< Match > QgsPointLocator::MatchList |
Definition at line 171 of file qgspointlocator.h.
The type of a snap result or the filter type for a snap request.
Enumerator | |
---|---|
Invalid | Invalid. |
Vertex | Snapped to a vertex. Can be a vertex of the geometry or an intersection. |
Edge | Snapped to an edge. |
Area | Snapped to an area. |
All | Combination of vertex, edge and area. |
Definition at line 78 of file qgspointlocator.h.
|
explicit |
Construct point locator for a layer.
Definition at line 613 of file qgspointlocator.cpp.
QgsPointLocator::~QgsPointLocator | ( | ) |
Definition at line 637 of file qgspointlocator.cpp.
|
inline |
Return how many geometries are cached in the index.
Definition at line 206 of file qgspointlocator.h.
const QgsCoordinateReferenceSystem * QgsPointLocator::destCRS | ( | ) | const |
Get destination CRS - may be null if not doing OTF reprojection.
Definition at line 645 of file qgspointlocator.cpp.
|
protectedslot |
Definition at line 762 of file qgspointlocator.cpp.
QgsPointLocator::MatchList QgsPointLocator::edgesInRect | ( | const QgsRectangle & | rect, |
QgsPointLocator::MatchFilter * | filter = nullptr |
||
) |
Find edges within a specified recangle Optional filter may discard unwanted matches.
Definition at line 877 of file qgspointlocator.cpp.
QgsPointLocator::MatchList QgsPointLocator::edgesInRect | ( | const QgsPoint & | point, |
double | tolerance, | ||
QgsPointLocator::MatchFilter * | filter = nullptr |
||
) |
Override of edgesInRect that construct rectangle from a center point and tolerance.
Definition at line 897 of file qgspointlocator.cpp.
|
inline |
Get extent of the area point locator covers - if null then it caches the whole layer.
Definition at line 70 of file qgspointlocator.h.
bool QgsPointLocator::hasIndex | ( | ) | const |
Indicate whether the data have been already indexed.
Definition at line 667 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 661 of file qgspointlocator.cpp.
|
inline |
QgsPointLocator::Match QgsPointLocator::nearestEdge | ( | const QgsPoint & | point, |
double | tolerance, | ||
MatchFilter * | filter = nullptr |
||
) |
Find nearest edges to the specified point - up to distance specified by tolerance Optional filter may discard unwanted matches.
Definition at line 855 of file qgspointlocator.cpp.
QgsPointLocator::Match QgsPointLocator::nearestVertex | ( | const QgsPoint & | point, |
double | tolerance, | ||
MatchFilter * | filter = nullptr |
||
) |
Find nearest vertex to the specified point - up to distance specified by tolerance Optional filter may discard unwanted matches.
Definition at line 837 of file qgspointlocator.cpp.
QgsPointLocator::MatchList QgsPointLocator::pointInPolygon | ( | const QgsPoint & | point | ) |
find out if the point is in any polygons
Definition at line 904 of file qgspointlocator.cpp.
|
protected |
Definition at line 673 of file qgspointlocator.cpp.
void QgsPointLocator::setExtent | ( | const QgsRectangle * | extent | ) |
Configure extent - if not null, it will index only that area.
Definition at line 650 of file qgspointlocator.cpp.
|
friend |
Definition at line 234 of file qgspointlocator.h.
|
friend |
Definition at line 235 of file qgspointlocator.h.
|
friend |
Definition at line 233 of file qgspointlocator.h.
|
friend |
Definition at line 232 of file qgspointlocator.h.