Skip to content

Commit

Permalink
use output field param's value executing gdal_polygonize, change defa…
Browse files Browse the repository at this point in the history
…ult output field name to DN (fix #5416)

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@132 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
brushtyler committed Apr 19, 2012
1 parent e9f0699 commit 8b18892
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/sextante/gdal/polygonize.py
@@ -1,4 +1,4 @@
from PyQt4 import QtGui
from PyQt4 import QtGui, QtCore
from sextante.core.GeoAlgorithm import GeoAlgorithm
from sextante.parameters.ParameterRaster import ParameterRaster
import os
Expand All @@ -21,7 +21,7 @@ def defineCharacteristics(self):
self.name = "polygonize"
self.group = "Conversion"
self.addParameter(ParameterRaster(polygonize.INPUT, "Input layer", False))
self.addParameter(ParameterString(polygonize.FIELD, "Output field name", "Value"))
self.addParameter(ParameterString(polygonize.FIELD, "Output field name", "DN"))
self.addOutput(OutputVector(polygonize.OUTPUT, "Output layer"))

def processAlgorithm(self, progress):
Expand All @@ -32,7 +32,9 @@ def processAlgorithm(self, progress):
commands.append(self.getParameterValue(polygonize.INPUT))
commands.append('-f')
commands.append('"ESRI Shapefile"')
commands.append(self.getOutputValue(polygonize.OUTPUT))
output = self.getOutputValue(polygonize.OUTPUT)
commands.append(output)
commands.append(QtCore.QFileInfo(output).baseName())
commands.append(self.getParameterValue(polygonize.FIELD))

GdalUtils.runGdal(commands, progress)

0 comments on commit 8b18892

Please sign in to comment.