Skip to content

Commit 7a35d62

Browse files
committedMay 21, 2015
[processing] add help links for gdal/ogr alga
1 parent f1dc58c commit 7a35d62

17 files changed

+55
-5
lines changed
 

‎python/plugins/processing/algs/gdal/ClipByExtent.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,6 @@ def getConsoleCommands(self):
8383
arguments.append(out)
8484

8585
return ['gdal_translate', GdalUtils.escapeAndJoin(arguments)]
86+
87+
def commandName(self):
88+
return "gdal_translate"

‎python/plugins/processing/algs/gdal/GdalAlgorithm.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@ def getCustomParametersDialog(self):
4747

4848
def processAlgorithm(self, progress):
4949
GdalUtils.runGdal(self.getConsoleCommands(), progress)
50+
51+
def help(self):
52+
try:
53+
return False, "http://www.gdal.org/%s.html" % self.commandName()
54+
except:
55+
return False, None
56+
57+
def commandName(self):
58+
alg = self.getCopy()
59+
for output in alg.outputs:
60+
output.setValue("dummy")
61+
for param in alg.parameters:
62+
param.setValue("1")
63+
name = alg.getConsoleCommands()[0]
64+
if name.endswith(".py"):
65+
name = name[:-3]
66+
return name
5067

5168

5269
class GdalScriptAlgorithm(ScriptAlgorithm):

‎python/plugins/processing/algs/gdal/aspect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,4 @@ def getConsoleCommands(self):
9292
arguments.append('-zero_for_flat')
9393

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

‎python/plugins/processing/algs/gdal/gdal2xyz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ def getConsoleCommands(self):
6868
else:
6969
commands = ['gdal2xyz.py', GdalUtils.escapeAndJoin(arguments)]
7070

71-
return commands, progress
71+
return commands

‎python/plugins/processing/algs/gdal/ogr2ogr.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,5 @@ def getConsoleCommands(self):
147147

148148
return commands
149149

150+
def commandName(self):
151+
return "ogr2ogr"

‎python/plugins/processing/algs/gdal/ogr2ogrbuffer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,6 @@ def getConsoleCommands(self):
123123
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
124124

125125
return commands
126+
127+
def commandName(self):
128+
return "ogr2ogr"

‎python/plugins/processing/algs/gdal/ogr2ogrclip.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,6 @@ def getConsoleCommands(self):
8686
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
8787

8888
return commands
89+
90+
def commandName(self):
91+
return "ogr2ogr"

‎python/plugins/processing/algs/gdal/ogr2ogrclipextent.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,6 @@ def getConsoleCommands(self):
9191
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
9292

9393
return commands
94+
95+
def commandName(self):
96+
return "ogr2ogr"

‎python/plugins/processing/algs/gdal/ogr2ogrdissolve.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,6 @@ def getConsoleCommands(self):
138138
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
139139

140140
return commands
141+
142+
def commandName(self):
143+
return "ogr2ogr"

‎python/plugins/processing/algs/gdal/ogr2ogronesidebuffer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,6 @@ def getConsoleCommands(self):
146146
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
147147

148148
return commands
149+
150+
def commandName(self):
151+
return "ogr2ogr"

‎python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,6 @@ def getConsoleCommands(self):
9999
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
100100

101101
return commands
102+
103+
def commandName(self):
104+
return "ogr2ogr"

‎python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,7 @@ def getConsoleCommands(self):
192192
else:
193193
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
194194

195-
return commands
195+
return commands
196+
197+
def commandName(self):
198+
return "ogr2ogr"

‎python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,6 @@ def getConsoleCommands(self):
274274
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
275275

276276
return commands
277+
278+
def commandName(self):
279+
return "ogr2ogr"

‎python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,6 @@ def getConsoleCommands(self):
280280
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
281281

282282
return commands
283+
284+
def commandName(self):
285+
return "ogr2ogr"

‎python/plugins/processing/algs/gdal/ogrinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def defineCharacteristics(self):
4848
self.addOutput(OutputHTML(self.OUTPUT, self.tr('Layer information')))
4949

5050
def getConsoleCommands(self):
51-
arguments = []
51+
arguments = ["orginfo"]
5252
arguments.append('-al')
5353
arguments.append('-so')
5454
layer = self.getParameterValue(self.INPUT)

‎python/plugins/processing/algs/gdal/rasterize_over.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def defineCharacteristics(self):
5454
self.addParameter(ParameterRaster(self.INPUT_RASTER,
5555
self.tr('Existing raster layer'), False))
5656

57-
def processAlgorithm(self, progress):
57+
def getConsoleCommands(self, progress):
5858
inLayer = self.getParameterValue(self.INPUT)
5959
ogrLayer = self.ogrConnectionString(inLayer)[1:-1]
6060
inRasterLayer = self.getParameterValue(self.INPUT_RASTER)

‎python/plugins/processing/core/GeoAlgorithm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def help(self):
119119

120120
qgsVersion = QGis.QGIS_VERSION_INT
121121
major = qgsVersion / 10000
122-
minor = minor = (qgsVersion - major * 10000) / 100
122+
minor = (qgsVersion - major * 10000) / 100
123123
if minor % 2 == 1:
124124
qgsVersion = 'testing'
125125
else:

0 commit comments

Comments
 (0)
Please sign in to comment.