Skip to content
Permalink
Browse files

Make ogrinfo summary info output optional

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 1b014fe1bd2e92a199635ce3343b1e947a8afde4
Showing with 8 additions and 1 deletion.
  1. +8 −1 python/plugins/processing/algs/gdal/ogrinfo.py
@@ -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
@@ -36,6 +38,7 @@
class OgrInfo(OgrAlgorithm):

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

def defineCharacteristics(self):
@@ -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)

0 comments on commit 1b014fe

Please sign in to comment.
You can’t perform that action at this time.