QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
#include <qgsgeometrysnapper.h>
Public Types | |
enum | SnapMode { PreferNodes = 0, PreferClosest, PreferNodesNoExtraVertices, PreferClosestNoExtraVertices, EndPointPreferNodes, EndPointPreferClosest, EndPointToEndPoint } |
Snapping modes. More... | |
Signals | |
void | featureSnapped () |
Emitted each time a feature has been processed when calling snapFeatures() More... | |
Public Member Functions | |
QgsGeometrySnapper (QgsFeatureSource *referenceSource) | |
Constructor for QgsGeometrySnapper. More... | |
QgsFeatureList | snapFeatures (const QgsFeatureList &features, double snapTolerance, SnapMode mode=PreferNodes) |
Snaps a set of features to the reference layer and returns the result. More... | |
QgsGeometry | snapGeometry (const QgsGeometry &geometry, double snapTolerance, SnapMode mode=PreferNodes) const |
Snaps a geometry to the reference layer and returns the result. More... | |
Static Public Member Functions | |
static QgsGeometry | snapGeometry (const QgsGeometry &geometry, double snapTolerance, const QList< QgsGeometry > &referenceGeometries, SnapMode mode=PreferNodes) |
Snaps a single geometry against a list of reference geometries. More... | |
QgsGeometrySnapper allows a geometry to be snapped to the geometries within a different reference layer. Vertices in the geometries will be modified to match the reference layer features within a specified snap tolerance.
Definition at line 39 of file qgsgeometrysnapper.h.
Snapping modes.
Definition at line 46 of file qgsgeometrysnapper.h.
QgsGeometrySnapper::QgsGeometrySnapper | ( | QgsFeatureSource * | referenceSource | ) |
Constructor for QgsGeometrySnapper.
A reference feature source which contains geometries to snap to must be set. It is assumed that all geometries snapped using this object will have the same CRS as the reference source (ie, no reprojection is performed).
Definition at line 460 of file qgsgeometrysnapper.cpp.
|
signal |
Emitted each time a feature has been processed when calling snapFeatures()
QgsFeatureList QgsGeometrySnapper::snapFeatures | ( | const QgsFeatureList & | features, |
double | snapTolerance, | ||
SnapMode | mode = PreferNodes |
||
) |
Snaps a set of features to the reference layer and returns the result.
This operation is multithreaded for performance. The featureSnapped() signal will be emitted each time a feature is processed. The snap tolerance is specified in the layer units for the reference layer.
Definition at line 467 of file qgsgeometrysnapper.cpp.
|
static |
Snaps a single geometry against a list of reference geometries.
Definition at line 505 of file qgsgeometrysnapper.cpp.
QgsGeometry QgsGeometrySnapper::snapGeometry | ( | const QgsGeometry & | geometry, |
double | snapTolerance, | ||
SnapMode | mode = PreferNodes |
||
) | const |
Snaps a geometry to the reference layer and returns the result.
The geometry must be in the same CRS as the reference layer, and must have the same type as the reference layer geometry. The snap tolerance is specified in the layer units for the reference layer.
Definition at line 481 of file qgsgeometrysnapper.cpp.