Class: QgsInternalGeometrySnapper¶
QgsInternalGeometrySnapper
allows a set of geometries to be
snapped to each other. It can be used to close gaps in layers.
To use QgsInternalGeometrySnapper
, first construct the
snapper using the desired snap parameters. Then, features are fed to to
the snapper one-by-one by calling snapFeature()
. Each feature
passed by calling snapFeature()
will be snapped to any
features which have already been processed by the snapper.
After processing all desired features, the results can be fetched by
calling snappedGeometries()
. The returned
QgsGeometryMap
can be passed to
QgsVectorDataProvider.changeGeometryValues()
to save the
snapped geometries back to the source layer.
Methods
Snaps a single feature's geometry against all feature geometries already processed by calls to |
|
Returns a |
- class qgis.analysis.QgsInternalGeometrySnapper[source]¶
Bases:
object
- __init__(snapTolerance: float, mode: QgsGeometrySnapper.SnapMode = QgsGeometrySnapper.PreferNodes)
Constructor for QgsInternalGeometrySnapper. The
snapTolerance
andmode
parameters dictate how geometries will be snapped by the snapper.- Parameters:
snapTolerance (float)
mode (QgsGeometrySnapper.SnapMode = QgsGeometrySnapper.PreferNodes)
- __init__(a0: QgsInternalGeometrySnapper)
- Parameters:
- snapFeature(self, feature: QgsFeature) QgsGeometry [source]¶
Snaps a single feature’s geometry against all feature geometries already processed by calls to
snapFeature()
in this object, and returns the snapped geometry.- Parameters:
feature (QgsFeature)
- Return type: