Skip to content

Commit

Permalink
Make ogrinfo summary info output optional
Browse files Browse the repository at this point in the history
Make summary output optional (but default) by adding a boolean parameter to the ogrinfo script

Signed-off-by: Henry Walshaw <henry.walshaw@gmail.com>
  • Loading branch information
om-henners committed Oct 8, 2015
1 parent 74f8d47 commit 1b014fe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/plugins/processing/algs/gdal/ogrinfo.py
Expand Up @@ -27,6 +27,8 @@


from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterBoolean

from processing.core.outputs import OutputHTML

from processing.algs.gdal.GdalUtils import GdalUtils
Expand All @@ -36,6 +38,7 @@
class OgrInfo(OgrAlgorithm):

INPUT = 'INPUT'
SUMMARY_ONLY = 'SUMMARY_ONLY'
OUTPUT = 'OUTPUT'

def defineCharacteristics(self):
Expand All @@ -44,13 +47,17 @@ def defineCharacteristics(self):

self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer'),
[ParameterVector.VECTOR_TYPE_ANY], False))
self.addParameter(ParameterBoolean(self.SUMMARY_ONLY,
self.tr('Summary output only'),
True))

self.addOutput(OutputHTML(self.OUTPUT, self.tr('Layer information')))

def getConsoleCommands(self):
arguments = ["ogrinfo"]
arguments.append('-al')
arguments.append('-so')
if self.getParameterValue(self.SUMMARY_ONLY):
arguments.append('-so')
layer = self.getParameterValue(self.INPUT)
conn = self.ogrConnectionString(layer)
arguments.append(conn)
Expand Down

0 comments on commit 1b014fe

Please sign in to comment.