Skip to content

Commit 88053cc

Browse files
author
volayaf
committedApr 24, 2012
fixed 5458
added crs param to gdal warp git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@146 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
1 parent d933f2b commit 88053cc

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed
 

‎src/sextante/gdal/pct2rgb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ def defineCharacteristics(self):
2121
self.name = "pct2rgb"
2222
self.group = "Conversion"
2323
self.addParameter(ParameterRaster(pct2rgb.INPUT, "Input layer", False))
24-
self.addParameter(ParameterSelection(pct2rgb.NBAND, "Band to convert", range(25)))
24+
options = []
25+
for i in range(25):
26+
options.append(str(i + 1))
27+
self.addParameter(ParameterSelection(pct2rgb.NBAND, "Band to convert", options))
2528
self.addOutput(OutputRaster(pct2rgb.OUTPUT, "Output layer"))
2629

2730
def processAlgorithm(self, progress):

‎src/sextante/gdal/warp.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from sextante.gdal.GdalUtils import GdalUtils
77
from sextante.parameters.ParameterString import ParameterString
88
from sextante.parameters.ParameterSelection import ParameterSelection
9+
from sextante.parameters.ParameterCrs import ParameterCrs
910

1011
class warp(GeoAlgorithm):
1112

@@ -24,17 +25,17 @@ def defineCharacteristics(self):
2425
self.name = "warp"
2526
self.group = "Projections"
2627
self.addParameter(ParameterRaster(warp.INPUT, "Input layer", False))
27-
self.addParameter(ParameterString(warp.SOURCE_SRS, "Source SRS (EPSG Code)", "4326"))
28-
self.addParameter(ParameterString(warp.DEST_SRS, "Destination SRS (EPSG Code)", "4326"))
28+
self.addParameter(ParameterCrs(warp.SOURCE_SRS, "Source SRS (EPSG Code)", "4326"))
29+
self.addParameter(ParameterCrs(warp.DEST_SRS, "Destination SRS (EPSG Code)", "4326"))
2930
self.addParameter(ParameterSelection(warp.METHOD, "Resampling method", warp.METHOD_OPTIONS))
3031
self.addOutput(OutputRaster(warp.OUTPUT, "Output layer"))
3132

3233
def processAlgorithm(self, progress):
3334
commands = ["gdalwarp"]
3435
commands.append("-s_srs")
35-
commands.append("EPSG:" + self.getParameterValue(warp.SOURCE_SRS))
36+
commands.append("EPSG:" + str(self.getParameterValue(warp.SOURCE_SRS)))
3637
commands.append("-t_srs")
37-
commands.append("EPSG:" + self.getParameterValue(warp.DEST_SRS))
38+
commands.append("EPSG:" + str(self.getParameterValue(warp.DEST_SRS)))
3839
commands.append("-r")
3940
commands.append(warp.METHOD_OPTIONS[self.getParameterValue(warp.METHOD)])
4041
commands.append("-of")

0 commit comments

Comments
 (0)
Please sign in to comment.