1
0
mirror of https://github.com/qgis/QGIS.git synced 2025-04-26 00:02:43 -04:00

[processing] add help links for gdal/ogr alga

This commit is contained in:
volaya 2015-05-21 15:43:47 +02:00
parent f1dc58ce01
commit 7a35d62b09
17 changed files with 55 additions and 5 deletions

@ -83,3 +83,6 @@ class ClipByExtent(GdalAlgorithm):
arguments.append(out) arguments.append(out)
return ['gdal_translate', GdalUtils.escapeAndJoin(arguments)] return ['gdal_translate', GdalUtils.escapeAndJoin(arguments)]
def commandName(self):
return "gdal_translate"

@ -48,6 +48,23 @@ class GdalAlgorithm(GeoAlgorithm):
def processAlgorithm(self, progress): def processAlgorithm(self, progress):
GdalUtils.runGdal(self.getConsoleCommands(), 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): class GdalScriptAlgorithm(ScriptAlgorithm):

@ -92,3 +92,4 @@ class aspect(GdalAlgorithm):
arguments.append('-zero_for_flat') arguments.append('-zero_for_flat')
return ['gdaldem', GdalUtils.escapeAndJoin(arguments)] return ['gdaldem', GdalUtils.escapeAndJoin(arguments)]

@ -68,4 +68,4 @@ class gdal2xyz(GdalAlgorithm):
else: else:
commands = ['gdal2xyz.py', GdalUtils.escapeAndJoin(arguments)] commands = ['gdal2xyz.py', GdalUtils.escapeAndJoin(arguments)]
return commands, progress return commands

@ -147,3 +147,5 @@ class Ogr2Ogr(OgrAlgorithm):
return commands return commands
def commandName(self):
return "ogr2ogr"

@ -123,3 +123,6 @@ class Ogr2OgrBuffer(OgrAlgorithm):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
return commands return commands
def commandName(self):
return "ogr2ogr"

@ -86,3 +86,6 @@ class Ogr2OgrClip(OgrAlgorithm):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
return commands return commands
def commandName(self):
return "ogr2ogr"

@ -91,3 +91,6 @@ class Ogr2OgrClipExtent(OgrAlgorithm):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
return commands return commands
def commandName(self):
return "ogr2ogr"

@ -138,3 +138,6 @@ class Ogr2OgrDissolve(OgrAlgorithm):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
return commands return commands
def commandName(self):
return "ogr2ogr"

@ -146,3 +146,6 @@ class Ogr2OgrOneSideBuffer(OgrAlgorithm):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
return commands return commands
def commandName(self):
return "ogr2ogr"

@ -99,3 +99,6 @@ class Ogr2OgrPointsOnLines(OgrAlgorithm):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
return commands return commands
def commandName(self):
return "ogr2ogr"

@ -193,3 +193,6 @@ class Ogr2OgrTableToPostGisList(OgrAlgorithm):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
return commands return commands
def commandName(self):
return "ogr2ogr"

@ -274,3 +274,6 @@ class Ogr2OgrToPostGis(OgrAlgorithm):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
return commands return commands
def commandName(self):
return "ogr2ogr"

@ -280,3 +280,6 @@ class Ogr2OgrToPostGisList(OgrAlgorithm):
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]
return commands return commands
def commandName(self):
return "ogr2ogr"

@ -48,7 +48,7 @@ class OgrInfo(OgrAlgorithm):
self.addOutput(OutputHTML(self.OUTPUT, self.tr('Layer information'))) self.addOutput(OutputHTML(self.OUTPUT, self.tr('Layer information')))
def getConsoleCommands(self): def getConsoleCommands(self):
arguments = [] arguments = ["orginfo"]
arguments.append('-al') arguments.append('-al')
arguments.append('-so') arguments.append('-so')
layer = self.getParameterValue(self.INPUT) layer = self.getParameterValue(self.INPUT)

@ -54,7 +54,7 @@ class rasterize_over(OgrAlgorithm):
self.addParameter(ParameterRaster(self.INPUT_RASTER, self.addParameter(ParameterRaster(self.INPUT_RASTER,
self.tr('Existing raster layer'), False)) self.tr('Existing raster layer'), False))
def processAlgorithm(self, progress): def getConsoleCommands(self, progress):
inLayer = self.getParameterValue(self.INPUT) inLayer = self.getParameterValue(self.INPUT)
ogrLayer = self.ogrConnectionString(inLayer)[1:-1] ogrLayer = self.ogrConnectionString(inLayer)[1:-1]
inRasterLayer = self.getParameterValue(self.INPUT_RASTER) inRasterLayer = self.getParameterValue(self.INPUT_RASTER)

@ -119,7 +119,7 @@ class GeoAlgorithm:
qgsVersion = QGis.QGIS_VERSION_INT qgsVersion = QGis.QGIS_VERSION_INT
major = qgsVersion / 10000 major = qgsVersion / 10000
minor = minor = (qgsVersion - major * 10000) / 100 minor = (qgsVersion - major * 10000) / 100
if minor % 2 == 1: if minor % 2 == 1:
qgsVersion = 'testing' qgsVersion = 'testing'
else: else: