Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Snap Geometries algorithm is capable of running in-place mode
(cherry picked from commit 4e1e684)
(cherry picked from commit c6b2970)
  • Loading branch information
nyalldawson committed Mar 17, 2020
1 parent 43cca03 commit 6a59ddd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/plugins/processing/algs/qgis/SnapGeometries.py
Expand Up @@ -26,6 +26,8 @@
QgsInternalGeometrySnapper)
from qgis.core import (QgsFeatureSink,
QgsProcessing,
QgsMapLayer,
QgsProcessingAlgorithm,
QgsProcessingException,
QgsProcessingParameterDistance,
QgsProcessingParameterFeatureSource,
Expand Down Expand Up @@ -83,6 +85,12 @@ def name(self):
def displayName(self):
return self.tr('Snap geometries to layer')

def flags(self):
return super().flags() | QgsProcessingAlgorithm.FlagSupportsInPlaceEdits

def supportInPlaceEdit(self, layer):
return layer.type() == QgsMapLayer.VectorLayer

def processAlgorithm(self, parameters, context, feedback):
source = self.parameterAsSource(parameters, self.INPUT, context)
if source is None:
Expand Down

0 comments on commit 6a59ddd

Please sign in to comment.