Subgroup: other

Class: QgsGeometrySnapper

class qgis.analysis.QgsGeometrySnapper

Bases: PyQt5.QtCore.QObject

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.

New in version 3.0: Methods

blockSignals
childEvent
children
connectNotify
customEvent
deleteLater
disconnect
disconnectNotify
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
inherits
installEventFilter
isSignalConnected
isWidgetType
isWindowType
killTimer
metaObject
moveToThread
objectName
parent
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
receivers
removeEventFilter
sender
senderSignalIndex
setObjectName
setParent
setProperty
signalsBlocked
snapFeatures Snaps a set of features to the reference layer and returns the result.
snapGeometry Snaps a geometry to the reference layer and returns the result.
startTimer
thread
timerEvent
tr

Attributes

EndPointPreferClosest
EndPointPreferNodes
EndPointToEndPoint
PreferClosest
PreferClosestNoExtraVertices
PreferNodes
PreferNodesNoExtraVertices
destroyed destroyed(self, QObject = None) [signal]
featureSnapped Emitted each time a feature has been processed when calling snapFeatures() [signal]
objectNameChanged objectNameChanged(self, str) [signal]
staticMetaObject
EndPointPreferClosest = 5
EndPointPreferNodes = 4
EndPointToEndPoint = 6
PreferClosest = 1
PreferClosestNoExtraVertices = 3
PreferNodes = 0
PreferNodesNoExtraVertices = 2
class SnapMode

Bases: int

childEvent()
connectNotify()
customEvent()
disconnectNotify()
featureSnapped

Emitted each time a feature has been processed when calling snapFeatures() [signal]

isSignalConnected()
receivers()
sender()
senderSignalIndex()
snapFeatures(self, features: object, snapTolerance: float, mode: QgsGeometrySnapper.SnapMode = QgsGeometrySnapper.PreferNodes) → object

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.

snapGeometry(self, geometry: QgsGeometry, snapTolerance: float, mode: QgsGeometrySnapper.SnapMode = QgsGeometrySnapper.PreferNodes) → QgsGeometry

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.

snapGeometry(geometry: QgsGeometry, snapTolerance: float, referenceGeometries: object, mode: QgsGeometrySnapper.SnapMode = QgsGeometrySnapper.PreferNodes) -> QgsGeometry Snaps a single geometry against a list of reference geometries.

timerEvent()