Skip to content

Commit

Permalink
[processing] move some constants to the dataobjects module
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Sep 2, 2016
1 parent 80653c7 commit 65db336
Show file tree
Hide file tree
Showing 149 changed files with 392 additions and 371 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def defineCharacteristics(self):
# We add the input vector layer. It can have any kind of geometry # We add the input vector layer. It can have any kind of geometry
# It is a mandatory (not optional) one, hence the False argument # It is a mandatory (not optional) one, hence the False argument
self.addParameter(ParameterVector(self.INPUT_LAYER, self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_ANY], False)) self.tr('Input layer'), [dataobjects.TYPE_VECTOR_ANY], False))


# We add a vector layer as output # We add a vector layer as output
self.addOutput(OutputVector(self.OUTPUT_LAYER, self.addOutput(OutputVector(self.OUTPUT_LAYER,
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ClipByMask.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction') self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction')
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False)) self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterVector(self.MASK, self.tr('Mask layer'), self.addParameter(ParameterVector(self.MASK, self.tr('Mask layer'),
[ParameterVector.VECTOR_TYPE_POLYGON])) [dataobjects.TYPE_VECTOR_POLYGON]))
self.addParameter(ParameterString(self.NO_DATA, self.addParameter(ParameterString(self.NO_DATA,
self.tr("Nodata value, leave blank to take the nodata value from input"), self.tr("Nodata value, leave blank to take the nodata value from input"),
'', optional=True)) '', optional=True))
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/gdal/GridAverage.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from processing.core.parameters import ParameterNumber from processing.core.parameters import ParameterNumber
from processing.core.parameters import ParameterSelection from processing.core.parameters import ParameterSelection
from processing.core.outputs import OutputRaster from processing.core.outputs import OutputRaster
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils


pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0] pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
Expand Down Expand Up @@ -64,7 +65,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Moving average)') self.name, self.i18n_name = self.trAlgorithm('Grid (Moving average)')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis') self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis')
self.addParameter(ParameterVector(self.INPUT, self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_POINT])) self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD, self.addParameter(ParameterTableField(self.Z_FIELD,
self.tr('Z field'), self.INPUT, self.tr('Z field'), self.INPUT,
ParameterTableField.DATA_TYPE_NUMBER, True)) ParameterTableField.DATA_TYPE_NUMBER, True))
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/GridDataMetrics.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@
from processing.core.parameters import ParameterSelection from processing.core.parameters import ParameterSelection
from processing.core.parameters import ParameterNumber from processing.core.parameters import ParameterNumber
from processing.core.outputs import OutputRaster from processing.core.outputs import OutputRaster
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils



pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0] pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]




Expand Down Expand Up @@ -68,7 +70,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Data metrics)') self.name, self.i18n_name = self.trAlgorithm('Grid (Data metrics)')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis') self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis')
self.addParameter(ParameterVector(self.INPUT, self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_POINT])) self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD, self.addParameter(ParameterTableField(self.Z_FIELD,
self.tr('Z field'), self.INPUT, self.tr('Z field'), self.INPUT,
ParameterTableField.DATA_TYPE_NUMBER, True)) ParameterTableField.DATA_TYPE_NUMBER, True))
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/gdal/GridInvDist.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from processing.core.parameters import ParameterSelection from processing.core.parameters import ParameterSelection
from processing.core.outputs import OutputRaster from processing.core.outputs import OutputRaster
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools import dataobjects


pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0] pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


Expand Down Expand Up @@ -68,7 +69,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Inverse distance to a power)') self.name, self.i18n_name = self.trAlgorithm('Grid (Inverse distance to a power)')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis') self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis')
self.addParameter(ParameterVector(self.INPUT, self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_POINT])) self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD, self.addParameter(ParameterTableField(self.Z_FIELD,
self.tr('Z field'), self.INPUT, self.tr('Z field'), self.INPUT,
ParameterTableField.DATA_TYPE_NUMBER, True)) ParameterTableField.DATA_TYPE_NUMBER, True))
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/gdal/GridNearest.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from processing.core.parameters import ParameterNumber from processing.core.parameters import ParameterNumber
from processing.core.parameters import ParameterSelection from processing.core.parameters import ParameterSelection
from processing.core.outputs import OutputRaster from processing.core.outputs import OutputRaster
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils


pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0] pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
Expand Down Expand Up @@ -64,7 +65,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Nearest neighbor)') self.name, self.i18n_name = self.trAlgorithm('Grid (Nearest neighbor)')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis') self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis')
self.addParameter(ParameterVector(self.INPUT, self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_POINT])) self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD, self.addParameter(ParameterTableField(self.Z_FIELD,
self.tr('Z field'), self.INPUT, self.tr('Z field'), self.INPUT,
ParameterTableField.DATA_TYPE_NUMBER, True)) ParameterTableField.DATA_TYPE_NUMBER, True))
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/gdal/buildvrt.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from processing.core.parameters import ParameterSelection from processing.core.parameters import ParameterSelection
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import tempFolder from processing.tools.system import tempFolder
from processing.tools import dataobjects


pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0] pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


Expand All @@ -57,7 +58,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Build Virtual Raster') self.name, self.i18n_name = self.trAlgorithm('Build Virtual Raster')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous') self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous')
self.addParameter(ParameterMultipleInput(self.INPUT, self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), ParameterMultipleInput.TYPE_RASTER)) self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterSelection(self.RESOLUTION, self.addParameter(ParameterSelection(self.RESOLUTION,
self.tr('Resolution'), self.RESOLUTION_OPTIONS, 0)) self.tr('Resolution'), self.RESOLUTION_OPTIONS, 0))
self.addParameter(ParameterBoolean(self.SEPARATE, self.addParameter(ParameterBoolean(self.SEPARATE,
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/gdal/gdaltindex.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from processing.core.parameters import ParameterBoolean from processing.core.parameters import ParameterBoolean
from processing.core.parameters import ParameterMultipleInput from processing.core.parameters import ParameterMultipleInput
from processing.core.parameters import ParameterString from processing.core.parameters import ParameterString
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils


pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0] pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
Expand All @@ -53,7 +54,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Tile Index') self.name, self.i18n_name = self.trAlgorithm('Tile Index')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous') self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous')
self.addParameter(ParameterMultipleInput(self.INPUT, self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), ParameterMultipleInput.TYPE_RASTER)) self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterString(self.FIELD_NAME, self.addParameter(ParameterString(self.FIELD_NAME,
self.tr('Tile index field'), self.tr('Tile index field'),
'location', optional=True)) 'location', optional=True))
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/gdal/merge.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from processing.core.parameters import ParameterMultipleInput from processing.core.parameters import ParameterMultipleInput
from processing.core.parameters import ParameterSelection from processing.core.parameters import ParameterSelection
from processing.tools.system import isWindows from processing.tools.system import isWindows
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils


pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0] pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
Expand All @@ -57,7 +58,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Merge') self.name, self.i18n_name = self.trAlgorithm('Merge')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous') self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous')
self.addParameter(ParameterMultipleInput(merge.INPUT, self.addParameter(ParameterMultipleInput(merge.INPUT,
self.tr('Input layers'), ParameterMultipleInput.TYPE_RASTER)) self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterBoolean(merge.PCT, self.addParameter(ParameterBoolean(merge.PCT,
self.tr('Grab pseudocolor table from first layer'), False)) self.tr('Grab pseudocolor table from first layer'), False))
self.addParameter(ParameterBoolean(merge.SEPARATE, self.addParameter(ParameterBoolean(merge.SEPARATE,
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ogr2ogr.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[OGR] Conversion') self.group, self.i18n_group = self.trAlgorithm('[OGR] Conversion')


self.addParameter(ParameterVector(self.INPUT_LAYER, self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_ANY], False)) self.tr('Input layer')))
self.addParameter(ParameterSelection(self.FORMAT, self.addParameter(ParameterSelection(self.FORMAT,
self.tr('Destination Format'), FORMATS)) self.tr('Destination Format'), FORMATS))
self.addParameter(ParameterString(self.OPTIONS, self.addParameter(ParameterString(self.OPTIONS,
Expand Down
5 changes: 3 additions & 2 deletions python/plugins/processing/algs/gdal/ogr2ogrbuffer.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils


from processing.tools import dataobjects
from processing.tools.system import isWindows from processing.tools.system import isWindows
from processing.tools.vector import ogrConnectionString, ogrLayerName from processing.tools.vector import ogrConnectionString, ogrLayerName


Expand All @@ -54,7 +55,7 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing') self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing')


self.addParameter(ParameterVector(self.INPUT_LAYER, self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_ANY], False)) self.tr('Input layer')))
self.addParameter(ParameterString(self.GEOMETRY, self.addParameter(ParameterString(self.GEOMETRY,
self.tr('Geometry column name ("geometry" for Shapefiles, may be different for other formats)'), self.tr('Geometry column name ("geometry" for Shapefiles, may be different for other formats)'),
'geometry', optional=False)) 'geometry', optional=False))
Expand All @@ -70,7 +71,7 @@ def defineCharacteristics(self):
self.tr('Additional creation options (see ogr2ogr manual)'), self.tr('Additional creation options (see ogr2ogr manual)'),
'', optional=True)) '', optional=True))


self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Buffer'))) self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Buffer'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))


def getConsoleCommands(self): def getConsoleCommands(self):
inLayer = self.getParameterValue(self.INPUT_LAYER) inLayer = self.getParameterValue(self.INPUT_LAYER)
Expand Down
7 changes: 4 additions & 3 deletions python/plugins/processing/algs/gdal/ogr2ogrclip.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils


from processing.tools import dataobjects
from processing.tools.system import isWindows from processing.tools.system import isWindows
from processing.tools.vector import ogrConnectionString, ogrLayerName from processing.tools.vector import ogrConnectionString, ogrLayerName


Expand All @@ -48,13 +49,13 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing') self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing')


self.addParameter(ParameterVector(self.INPUT_LAYER, self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_ANY], False)) self.tr('Input layer')))
self.addParameter(ParameterVector(self.CLIP_LAYER, self.addParameter(ParameterVector(self.CLIP_LAYER,
self.tr('Clip layer'), [ParameterVector.VECTOR_TYPE_POLYGON], False)) self.tr('Clip layer'), [dataobjects.TYPE_VECTOR_POLYGON]))
self.addParameter(ParameterString(self.OPTIONS, self.addParameter(ParameterString(self.OPTIONS,
self.tr('Additional creation options'), '', optional=True)) self.tr('Additional creation options'), '', optional=True))


self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Clipped (polygon)'))) self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Clipped (polygon)'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))


def getConsoleCommands(self): def getConsoleCommands(self):
inLayer = self.getParameterValue(self.INPUT_LAYER) inLayer = self.getParameterValue(self.INPUT_LAYER)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ogr2ogrclipextent.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing') self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing')


self.addParameter(ParameterVector(self.INPUT_LAYER, self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_ANY], False)) self.tr('Input layer')))
self.addParameter(ParameterExtent(self.CLIP_EXTENT, self.addParameter(ParameterExtent(self.CLIP_EXTENT,
self.tr('Clip extent'))) self.tr('Clip extent')))
self.addParameter(ParameterString(self.OPTIONS, self.addParameter(ParameterString(self.OPTIONS,
Expand Down
5 changes: 3 additions & 2 deletions python/plugins/processing/algs/gdal/ogr2ogrdissolve.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils


from processing.tools import dataobjects
from processing.tools.system import isWindows from processing.tools.system import isWindows
from processing.tools.vector import ogrConnectionString, ogrLayerName from processing.tools.vector import ogrConnectionString, ogrLayerName


Expand All @@ -57,7 +58,7 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing') self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing')


self.addParameter(ParameterVector(self.INPUT_LAYER, self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_POLYGON], False)) self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POLYGON]))
self.addParameter(ParameterString(self.GEOMETRY, self.addParameter(ParameterString(self.GEOMETRY,
self.tr('Geometry column name ("geometry" for Shapefiles, may be different for other formats)'), self.tr('Geometry column name ("geometry" for Shapefiles, may be different for other formats)'),
'geometry', optional=False)) 'geometry', optional=False))
Expand All @@ -79,7 +80,7 @@ def defineCharacteristics(self):
self.tr('Additional creation options (see ogr2ogr manual)'), self.tr('Additional creation options (see ogr2ogr manual)'),
'', optional=True)) '', optional=True))


self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Dissolved'))) self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Dissolved'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))


def getConsoleCommands(self): def getConsoleCommands(self):
inLayer = self.getParameterValue(self.INPUT_LAYER) inLayer = self.getParameterValue(self.INPUT_LAYER)
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/gdal/ogr2ogronesidebuffer.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils


from processing.tools import dataobjects
from processing.tools.system import isWindows from processing.tools.system import isWindows
from processing.tools.vector import ogrConnectionString, ogrLayerName from processing.tools.vector import ogrConnectionString, ogrLayerName


Expand All @@ -59,7 +60,7 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing') self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing')


self.addParameter(ParameterVector(self.INPUT_LAYER, self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_LINE], False)) self.tr('Input layer'), [dataobjects.TYPE_VECTOR_LINE], False))
self.addParameter(ParameterSelection(self.OPERATION, self.addParameter(ParameterSelection(self.OPERATION,
self.tr('Operation'), self.OPERATIONLIST, 0)) self.tr('Operation'), self.OPERATIONLIST, 0))
self.addParameter(ParameterString(self.GEOMETRY, self.addParameter(ParameterString(self.GEOMETRY,
Expand Down
5 changes: 3 additions & 2 deletions python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils


from processing.tools import dataobjects
from processing.tools.system import isWindows from processing.tools.system import isWindows
from processing.tools.vector import ogrConnectionString, ogrLayerName from processing.tools.vector import ogrConnectionString, ogrLayerName


Expand All @@ -50,7 +51,7 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing') self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing')


self.addParameter(ParameterVector(self.INPUT_LAYER, self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_LINE], False)) self.tr('Input layer'), [dataobjects.TYPE_VECTOR_LINE], False))
self.addParameter(ParameterString(self.GEOMETRY, self.addParameter(ParameterString(self.GEOMETRY,
self.tr('Geometry column name ("geometry" for Shapefiles, may be different for other formats)'), self.tr('Geometry column name ("geometry" for Shapefiles, may be different for other formats)'),
'geometry', optional=False)) 'geometry', optional=False))
Expand All @@ -60,7 +61,7 @@ def defineCharacteristics(self):
self.tr('Additional creation options (see ogr2ogr manual)'), self.tr('Additional creation options (see ogr2ogr manual)'),
'', optional=True)) '', optional=True))


self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Points along lines'))) self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Points along lines'), datatype=[dataobjects.TYPE_VECTOR_POINT]))


def getConsoleCommands(self): def getConsoleCommands(self):
inLayer = self.getParameterValue(self.INPUT_LAYER) inLayer = self.getParameterValue(self.INPUT_LAYER)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Import Vector into PostGIS database (new connection)') self.name, self.i18n_name = self.trAlgorithm('Import Vector into PostGIS database (new connection)')
self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous') self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous')
self.addParameter(ParameterVector(self.INPUT_LAYER, self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_ANY], False)) self.tr('Input layer')))
self.addParameter(ParameterString(self.SHAPE_ENCODING, self.addParameter(ParameterString(self.SHAPE_ENCODING,
self.tr('Shape encoding'), "", optional=True)) self.tr('Shape encoding'), "", optional=True))
self.addParameter(ParameterSelection(self.GTYPE, self.addParameter(ParameterSelection(self.GTYPE,
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def defineCharacteristics(self):
self.addParameter(ParameterSelection(self.DATABASE, self.addParameter(ParameterSelection(self.DATABASE,
self.tr('Database (connection name)'), self.DB_CONNECTIONS)) self.tr('Database (connection name)'), self.DB_CONNECTIONS))
self.addParameter(ParameterVector(self.INPUT_LAYER, self.addParameter(ParameterVector(self.INPUT_LAYER,
self.tr('Input layer'), [ParameterVector.VECTOR_TYPE_ANY], False)) self.tr('Input layer')))
self.addParameter(ParameterString(self.SHAPE_ENCODING, self.addParameter(ParameterString(self.SHAPE_ENCODING,
self.tr('Shape encoding'), "", optional=True)) self.tr('Shape encoding'), "", optional=True))
self.addParameter(ParameterSelection(self.GTYPE, self.addParameter(ParameterSelection(self.GTYPE,
Expand Down
3 changes: 1 addition & 2 deletions python/plugins/processing/algs/gdal/ogrinfo.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Information') self.name, self.i18n_name = self.trAlgorithm('Information')
self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous') self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous')


self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer'), self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer')))
[ParameterVector.VECTOR_TYPE_ANY], False))
self.addParameter(ParameterBoolean(self.SUMMARY_ONLY, self.addParameter(ParameterBoolean(self.SUMMARY_ONLY,
self.tr('Summary output only'), self.tr('Summary output only'),
True)) True))
Expand Down
3 changes: 1 addition & 2 deletions python/plugins/processing/algs/gdal/ogrsql.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Execute SQL') self.name, self.i18n_name = self.trAlgorithm('Execute SQL')
self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous') self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous')


self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer'), self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer')))
[ParameterVector.VECTOR_TYPE_ANY], False))
self.addParameter(ParameterString(self.SQL, self.tr('SQL'), '')) self.addParameter(ParameterString(self.SQL, self.tr('SQL'), ''))


self.addParameter(ParameterSelection( self.addParameter(ParameterSelection(
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/gdal/retile.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from processing.core.parameters import ParameterBoolean from processing.core.parameters import ParameterBoolean
from processing.core.outputs import OutputDirectory from processing.core.outputs import OutputDirectory
from processing.tools.system import isWindows from processing.tools.system import isWindows
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils from processing.algs.gdal.GdalUtils import GdalUtils
import re import re


Expand Down Expand Up @@ -71,7 +72,7 @@ def defineCharacteristics(self):
# Required parameters # Required parameters
self.addParameter(ParameterMultipleInput(self.INPUT, self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), self.tr('Input layers'),
ParameterMultipleInput.TYPE_RASTER)) dataobjects.TYPE_RASTER))
# Advanced parameters # Advanced parameters
params = [] params = []
params.append(ParameterString(self.PIXELSIZE, params.append(ParameterString(self.PIXELSIZE,
Expand Down
Loading

0 comments on commit 65db336

Please sign in to comment.