Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] corrected parameter definition in Eliminate
  • Loading branch information
volaya committed Sep 21, 2013
1 parent e527fe3 commit 56d6496
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/plugins/processing/algs/ftools/Eliminate.py
Expand Up @@ -49,7 +49,7 @@ def defineCharacteristics(self):
self.name = "Eliminate sliver polygons"
self.group = "Vector geometry tools"
self.addParameter(ParameterVector(self.INPUT, "Input layer", [ParameterVector.VECTOR_TYPE_POLYGON]))
self.addParameter(ParameterSelection(self.MODE, "Segments", self.MODES))
self.addParameter(ParameterSelection(self.MODE, "Merge selection with the neighbouring polygon with the largest", self.MODES))
self.addOutput(OutputVector(self.OUTPUT, "Cleaned layer"))

def processAlgorithm(self, progress):
Expand Down Expand Up @@ -183,3 +183,9 @@ def saveChanges(self, outLayer):
msg = msg + "\n" + aStrm
outLayer.rollBack()
raise GeoAlgorithmExecutionException("Commit error:\n%s" % (msg))

def checkParameterValuesBeforeExecuting(self):
inLayer = dataobjects.getObjectFromUri(self.getParameterValue(self.INPUT))
if inLayer.selectedFeatureCount() == 0:
return "No selection in input layer"

0 comments on commit 56d6496

Please sign in to comment.