diff --git a/python/plugins/processing/algs/gdal/ClipByExtent.py b/python/plugins/processing/algs/gdal/ClipByExtent.py index 0f453fd4ea4..47e4d6c2efa 100644 --- a/python/plugins/processing/algs/gdal/ClipByExtent.py +++ b/python/plugins/processing/algs/gdal/ClipByExtent.py @@ -83,3 +83,6 @@ class ClipByExtent(GdalAlgorithm): arguments.append(out) return ['gdal_translate', GdalUtils.escapeAndJoin(arguments)] + + def commandName(self): + return "gdal_translate" \ No newline at end of file diff --git a/python/plugins/processing/algs/gdal/GdalAlgorithm.py b/python/plugins/processing/algs/gdal/GdalAlgorithm.py index 8ae12dcd749..1f795e083cd 100644 --- a/python/plugins/processing/algs/gdal/GdalAlgorithm.py +++ b/python/plugins/processing/algs/gdal/GdalAlgorithm.py @@ -47,6 +47,23 @@ class GdalAlgorithm(GeoAlgorithm): def processAlgorithm(self, progress): GdalUtils.runGdal(self.getConsoleCommands(), progress) + + def help(self): + try: + return False, "http://www.gdal.org/%s.html" % self.commandName() + except: + return False, None + + def commandName(self): + alg = self.getCopy() + for output in alg.outputs: + output.setValue("dummy") + for param in alg.parameters: + param.setValue("1") + name = alg.getConsoleCommands()[0] + if name.endswith(".py"): + name = name[:-3] + return name class GdalScriptAlgorithm(ScriptAlgorithm): diff --git a/python/plugins/processing/algs/gdal/aspect.py b/python/plugins/processing/algs/gdal/aspect.py index 05d1c2a385b..458fb106938 100644 --- a/python/plugins/processing/algs/gdal/aspect.py +++ b/python/plugins/processing/algs/gdal/aspect.py @@ -92,3 +92,4 @@ class aspect(GdalAlgorithm): arguments.append('-zero_for_flat') return ['gdaldem', GdalUtils.escapeAndJoin(arguments)] + diff --git a/python/plugins/processing/algs/gdal/gdal2xyz.py b/python/plugins/processing/algs/gdal/gdal2xyz.py index 96bd54af223..33f7c7adcee 100644 --- a/python/plugins/processing/algs/gdal/gdal2xyz.py +++ b/python/plugins/processing/algs/gdal/gdal2xyz.py @@ -68,4 +68,4 @@ class gdal2xyz(GdalAlgorithm): else: commands = ['gdal2xyz.py', GdalUtils.escapeAndJoin(arguments)] - return commands, progress + return commands diff --git a/python/plugins/processing/algs/gdal/ogr2ogr.py b/python/plugins/processing/algs/gdal/ogr2ogr.py index a3b7ef21523..bac2140062a 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogr.py +++ b/python/plugins/processing/algs/gdal/ogr2ogr.py @@ -147,3 +147,5 @@ class Ogr2Ogr(OgrAlgorithm): return commands + def commandName(self): + return "ogr2ogr" \ No newline at end of file diff --git a/python/plugins/processing/algs/gdal/ogr2ogrbuffer.py b/python/plugins/processing/algs/gdal/ogr2ogrbuffer.py index 50440a039c2..26b0ebc569d 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogrbuffer.py +++ b/python/plugins/processing/algs/gdal/ogr2ogrbuffer.py @@ -123,3 +123,6 @@ class Ogr2OgrBuffer(OgrAlgorithm): commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] return commands + + def commandName(self): + return "ogr2ogr" \ No newline at end of file diff --git a/python/plugins/processing/algs/gdal/ogr2ogrclip.py b/python/plugins/processing/algs/gdal/ogr2ogrclip.py index 4855daa2eb2..885ca48dc5f 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogrclip.py +++ b/python/plugins/processing/algs/gdal/ogr2ogrclip.py @@ -86,3 +86,6 @@ class Ogr2OgrClip(OgrAlgorithm): commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] return commands + + def commandName(self): + return "ogr2ogr" diff --git a/python/plugins/processing/algs/gdal/ogr2ogrclipextent.py b/python/plugins/processing/algs/gdal/ogr2ogrclipextent.py index 82aceed68bc..4735a85bd28 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogrclipextent.py +++ b/python/plugins/processing/algs/gdal/ogr2ogrclipextent.py @@ -91,3 +91,6 @@ class Ogr2OgrClipExtent(OgrAlgorithm): commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] return commands + + def commandName(self): + return "ogr2ogr" \ No newline at end of file diff --git a/python/plugins/processing/algs/gdal/ogr2ogrdissolve.py b/python/plugins/processing/algs/gdal/ogr2ogrdissolve.py index 348f1f27822..ed8484a6cd9 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogrdissolve.py +++ b/python/plugins/processing/algs/gdal/ogr2ogrdissolve.py @@ -138,3 +138,6 @@ class Ogr2OgrDissolve(OgrAlgorithm): commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] return commands + + def commandName(self): + return "ogr2ogr" diff --git a/python/plugins/processing/algs/gdal/ogr2ogronesidebuffer.py b/python/plugins/processing/algs/gdal/ogr2ogronesidebuffer.py index ab4a498fcfa..2500150ceff 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogronesidebuffer.py +++ b/python/plugins/processing/algs/gdal/ogr2ogronesidebuffer.py @@ -146,3 +146,6 @@ class Ogr2OgrOneSideBuffer(OgrAlgorithm): commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] return commands + + def commandName(self): + return "ogr2ogr" \ No newline at end of file diff --git a/python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py b/python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py index 1bd784c573b..cccd8130cd5 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py +++ b/python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py @@ -99,3 +99,6 @@ class Ogr2OgrPointsOnLines(OgrAlgorithm): commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] return commands + + def commandName(self): + return "ogr2ogr" \ No newline at end of file diff --git a/python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py b/python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py index 60ba93f4895..bc6c289923e 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py +++ b/python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py @@ -192,4 +192,7 @@ class Ogr2OgrTableToPostGisList(OgrAlgorithm): else: commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] - return commands \ No newline at end of file + return commands + + def commandName(self): + return "ogr2ogr" \ No newline at end of file diff --git a/python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py b/python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py index f52105c3985..01b984dd837 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py +++ b/python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py @@ -274,3 +274,6 @@ class Ogr2OgrToPostGis(OgrAlgorithm): commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] return commands + + def commandName(self): + return "ogr2ogr" \ No newline at end of file diff --git a/python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py b/python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py index 0510896d72f..6b395108fd1 100644 --- a/python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py +++ b/python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py @@ -280,3 +280,6 @@ class Ogr2OgrToPostGisList(OgrAlgorithm): commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] return commands + + def commandName(self): + return "ogr2ogr" \ No newline at end of file diff --git a/python/plugins/processing/algs/gdal/ogrinfo.py b/python/plugins/processing/algs/gdal/ogrinfo.py index 4147737b14e..5f34f866114 100644 --- a/python/plugins/processing/algs/gdal/ogrinfo.py +++ b/python/plugins/processing/algs/gdal/ogrinfo.py @@ -48,7 +48,7 @@ class OgrInfo(OgrAlgorithm): self.addOutput(OutputHTML(self.OUTPUT, self.tr('Layer information'))) def getConsoleCommands(self): - arguments = [] + arguments = ["orginfo"] arguments.append('-al') arguments.append('-so') layer = self.getParameterValue(self.INPUT) diff --git a/python/plugins/processing/algs/gdal/rasterize_over.py b/python/plugins/processing/algs/gdal/rasterize_over.py index 429127c8ca2..3886ee8e3ce 100644 --- a/python/plugins/processing/algs/gdal/rasterize_over.py +++ b/python/plugins/processing/algs/gdal/rasterize_over.py @@ -54,7 +54,7 @@ class rasterize_over(OgrAlgorithm): self.addParameter(ParameterRaster(self.INPUT_RASTER, self.tr('Existing raster layer'), False)) - def processAlgorithm(self, progress): + def getConsoleCommands(self, progress): inLayer = self.getParameterValue(self.INPUT) ogrLayer = self.ogrConnectionString(inLayer)[1:-1] inRasterLayer = self.getParameterValue(self.INPUT_RASTER) diff --git a/python/plugins/processing/core/GeoAlgorithm.py b/python/plugins/processing/core/GeoAlgorithm.py index f946fbbfa66..8c828c518d1 100644 --- a/python/plugins/processing/core/GeoAlgorithm.py +++ b/python/plugins/processing/core/GeoAlgorithm.py @@ -119,7 +119,7 @@ class GeoAlgorithm: qgsVersion = QGis.QGIS_VERSION_INT major = qgsVersion / 10000 - minor = minor = (qgsVersion - major * 10000) / 100 + minor = (qgsVersion - major * 10000) / 100 if minor % 2 == 1: qgsVersion = 'testing' else: