- class qgis.analysis.QgsInternalGeometrySnapper¶
QgsInternalGeometrySnapperallows a set of geometries to be snapped to each other. It can be used to close gaps in layers.
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
QgsGeometryMapcan be passed to
QgsVectorDataProvider.changeGeometryValues()to save the snapped geometries back to the source layer.
New in version 3.0.
QgsInternalGeometrySnapper(snapTolerance: float, mode: QgsGeometrySnapper.SnapMode = QgsGeometrySnapper.PreferNodes) Constructor for
modeparameters dictate how geometries will be snapped by the snapper.
- snapFeature(self, feature: QgsFeature) → QgsGeometry¶
Snaps a single feature’s geometry against all feature geometries already processed by calls to
snapFeature()in this object, and returns the snapped geometry.
- snappedGeometries(self) → object¶
QgsGeometryMapof all feature geometries snapped by this object.
- Return type