Skip to content

Commit 6e4bff4

Browse files
author
julien.malik@gmail.com
committed
[gdal] fix polygonize (at least for linux)
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@92 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
1 parent 21e6c16 commit 6e4bff4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/sextante/gdal/polygonize.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from sextante.gdal.GdalUtils import GdalUtils
66
from sextante.parameters.ParameterString import ParameterString
77
from sextante.outputs.OutputVector import OutputVector
8+
from sextante.core.SextanteUtils import SextanteUtils
89

910
class polygonize(GeoAlgorithm):
1011

@@ -24,11 +25,14 @@ def defineCharacteristics(self):
2425
self.addOutput(OutputVector(polygonize.OUTPUT, "Output layer"))
2526

2627
def processAlgorithm(self, progress):
27-
commands = ["gdal_polygonize"]
28+
if SextanteUtils.isWindows():
29+
commands = ["cmd.exe", "/C ", "gdal_polygonize.bat"]
30+
else:
31+
commands = ["gdal_polygonize.py"]
2832
commands.append(self.getParameterValue(polygonize.INPUT))
29-
commands.append("-f")
30-
commands.append("ESRI Shapefile")
33+
commands.append('-f')
34+
commands.append('"ESRI Shapefile"')
3135
commands.append(self.getOutputValue(polygonize.OUTPUT))
3236
commands.append(self.getParameterValue(polygonize.FIELD))
33-
37+
3438
GdalUtils.runGdal(commands, progress)

0 commit comments

Comments
 (0)