Skip to content

Commit

Permalink
[processing] add help links for gdal/ogr alga
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed May 21, 2015
1 parent f1dc58c commit 7a35d62
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 5 deletions.
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ClipByExtent.py
Expand Up @@ -83,3 +83,6 @@ def getConsoleCommands(self):
arguments.append(out)

return ['gdal_translate', GdalUtils.escapeAndJoin(arguments)]

def commandName(self):
return "gdal_translate"
17 changes: 17 additions & 0 deletions python/plugins/processing/algs/gdal/GdalAlgorithm.py
Expand Up @@ -47,6 +47,23 @@ def getCustomParametersDialog(self):

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):
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/aspect.py
Expand Up @@ -92,3 +92,4 @@ def getConsoleCommands(self):
arguments.append('-zero_for_flat')

return ['gdaldem', GdalUtils.escapeAndJoin(arguments)]

2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/gdal2xyz.py
Expand Up @@ -68,4 +68,4 @@ def getConsoleCommands(self):
else:
commands = ['gdal2xyz.py', GdalUtils.escapeAndJoin(arguments)]

return commands, progress
return commands
2 changes: 2 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogr.py
Expand Up @@ -147,3 +147,5 @@ def getConsoleCommands(self):

return commands

def commandName(self):
return "ogr2ogr"
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogrbuffer.py
Expand Up @@ -123,3 +123,6 @@ def getConsoleCommands(self):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]

return commands

def commandName(self):
return "ogr2ogr"
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogrclip.py
Expand Up @@ -86,3 +86,6 @@ def getConsoleCommands(self):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]

return commands

def commandName(self):
return "ogr2ogr"
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogrclipextent.py
Expand Up @@ -91,3 +91,6 @@ def getConsoleCommands(self):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]

return commands

def commandName(self):
return "ogr2ogr"
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogrdissolve.py
Expand Up @@ -138,3 +138,6 @@ def getConsoleCommands(self):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]

return commands

def commandName(self):
return "ogr2ogr"
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogronesidebuffer.py
Expand Up @@ -146,3 +146,6 @@ def getConsoleCommands(self):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]

return commands

def commandName(self):
return "ogr2ogr"
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py
Expand Up @@ -99,3 +99,6 @@ def getConsoleCommands(self):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]

return commands

def commandName(self):
return "ogr2ogr"
Expand Up @@ -192,4 +192,7 @@ def getConsoleCommands(self):
else:
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]

return commands
return commands

def commandName(self):
return "ogr2ogr"
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py
Expand Up @@ -274,3 +274,6 @@ def getConsoleCommands(self):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]

return commands

def commandName(self):
return "ogr2ogr"
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py
Expand Up @@ -280,3 +280,6 @@ def getConsoleCommands(self):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]

return commands

def commandName(self):
return "ogr2ogr"
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ogrinfo.py
Expand Up @@ -48,7 +48,7 @@ def defineCharacteristics(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/rasterize_over.py
Expand Up @@ -54,7 +54,7 @@ def defineCharacteristics(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/core/GeoAlgorithm.py
Expand Up @@ -119,7 +119,7 @@ def help(self):

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:
Expand Down

0 comments on commit 7a35d62

Please sign in to comment.