Skip to content

Commit

Permalink
fixed 5458
Browse files Browse the repository at this point in the history
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
  • Loading branch information
volayaf committed Apr 24, 2012
1 parent d933f2b commit 88053cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/sextante/gdal/pct2rgb.py
Expand Up @@ -21,7 +21,10 @@ def defineCharacteristics(self):
self.name = "pct2rgb"
self.group = "Conversion"
self.addParameter(ParameterRaster(pct2rgb.INPUT, "Input layer", False))
self.addParameter(ParameterSelection(pct2rgb.NBAND, "Band to convert", range(25)))
options = []
for i in range(25):
options.append(str(i + 1))
self.addParameter(ParameterSelection(pct2rgb.NBAND, "Band to convert", options))
self.addOutput(OutputRaster(pct2rgb.OUTPUT, "Output layer"))

def processAlgorithm(self, progress):
Expand Down
9 changes: 5 additions & 4 deletions src/sextante/gdal/warp.py
Expand Up @@ -6,6 +6,7 @@
from sextante.gdal.GdalUtils import GdalUtils
from sextante.parameters.ParameterString import ParameterString
from sextante.parameters.ParameterSelection import ParameterSelection
from sextante.parameters.ParameterCrs import ParameterCrs

class warp(GeoAlgorithm):

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

def processAlgorithm(self, progress):
commands = ["gdalwarp"]
commands.append("-s_srs")
commands.append("EPSG:" + self.getParameterValue(warp.SOURCE_SRS))
commands.append("EPSG:" + str(self.getParameterValue(warp.SOURCE_SRS)))
commands.append("-t_srs")
commands.append("EPSG:" + self.getParameterValue(warp.DEST_SRS))
commands.append("EPSG:" + str(self.getParameterValue(warp.DEST_SRS)))
commands.append("-r")
commands.append(warp.METHOD_OPTIONS[self.getParameterValue(warp.METHOD)])
commands.append("-of")
Expand Down

0 comments on commit 88053cc

Please sign in to comment.