Skip to content
Permalink
Browse files

[processing] move some constants to the dataobjects module

  • Loading branch information
alexbruy committed Sep 2, 2016
1 parent 80653c7 commit 65db336eaf2c60a03a11fb10282ebbb3f5872052
Showing with 392 additions and 371 deletions.
  1. +1 −1 python/plugins/processing/algs/exampleprovider/ExampleAlgorithm.py
  2. +1 −1 python/plugins/processing/algs/gdal/ClipByMask.py
  3. +2 −1 python/plugins/processing/algs/gdal/GridAverage.py
  4. +3 −1 python/plugins/processing/algs/gdal/GridDataMetrics.py
  5. +2 −1 python/plugins/processing/algs/gdal/GridInvDist.py
  6. +2 −1 python/plugins/processing/algs/gdal/GridNearest.py
  7. +2 −1 python/plugins/processing/algs/gdal/buildvrt.py
  8. +2 −1 python/plugins/processing/algs/gdal/gdaltindex.py
  9. +2 −1 python/plugins/processing/algs/gdal/merge.py
  10. +1 −1 python/plugins/processing/algs/gdal/ogr2ogr.py
  11. +3 −2 python/plugins/processing/algs/gdal/ogr2ogrbuffer.py
  12. +4 −3 python/plugins/processing/algs/gdal/ogr2ogrclip.py
  13. +1 −1 python/plugins/processing/algs/gdal/ogr2ogrclipextent.py
  14. +3 −2 python/plugins/processing/algs/gdal/ogr2ogrdissolve.py
  15. +2 −1 python/plugins/processing/algs/gdal/ogr2ogronesidebuffer.py
  16. +3 −2 python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py
  17. +1 −1 python/plugins/processing/algs/gdal/ogr2ogrtopostgis.py
  18. +1 −1 python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py
  19. +1 −2 python/plugins/processing/algs/gdal/ogrinfo.py
  20. +1 −2 python/plugins/processing/algs/gdal/ogrsql.py
  21. +2 −1 python/plugins/processing/algs/gdal/retile.py
  22. +5 −5 python/plugins/processing/algs/grass/GrassAlgorithm.py
  23. +3 −3 python/plugins/processing/algs/grass/nviz.py
  24. +5 −5 python/plugins/processing/algs/grass7/Grass7Algorithm.py
  25. +3 −3 python/plugins/processing/algs/grass7/nviz7.py
  26. +3 −1 python/plugins/processing/algs/lidar/lastools/lasclip.py
  27. +1 −1 python/plugins/processing/algs/qgis/AddTableField.py
  28. +1 −1 python/plugins/processing/algs/qgis/AutoincrementalField.py
  29. +1 −1 python/plugins/processing/algs/qgis/BasicStatisticsNumbers.py
  30. +1 −2 python/plugins/processing/algs/qgis/BasicStatisticsStrings.py
  31. +2 −2 python/plugins/processing/algs/qgis/Boundary.py
  32. +2 −2 python/plugins/processing/algs/qgis/BoundingBox.py
  33. +2 −2 python/plugins/processing/algs/qgis/Centroids.py
  34. +1 −2 python/plugins/processing/algs/qgis/CheckValidity.py
  35. +2 −2 python/plugins/processing/algs/qgis/Clip.py
  36. +2 −2 python/plugins/processing/algs/qgis/ConcaveHull.py
  37. +2 −2 python/plugins/processing/algs/qgis/ConvexHull.py
  38. +1 −2 python/plugins/processing/algs/qgis/Datasources2Vrt.py
  39. +1 −2 python/plugins/processing/algs/qgis/DefineProjection.py
  40. +4 −3 python/plugins/processing/algs/qgis/Delaunay.py
  41. +1 −1 python/plugins/processing/algs/qgis/DeleteColumn.py
  42. +1 −1 python/plugins/processing/algs/qgis/DeleteDuplicateGeometries.py
  43. +2 −2 python/plugins/processing/algs/qgis/DeleteHoles.py
  44. +1 −1 python/plugins/processing/algs/qgis/DensifyGeometries.py
  45. +1 −1 python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py
  46. +2 −2 python/plugins/processing/algs/qgis/Difference.py
  47. +1 −1 python/plugins/processing/algs/qgis/Dissolve.py
  48. +2 −2 python/plugins/processing/algs/qgis/Eliminate.py
  49. +1 −1 python/plugins/processing/algs/qgis/EquivalentNumField.py
  50. +0 −1 python/plugins/processing/algs/qgis/ExecuteSQL.py
  51. +3 −2 python/plugins/processing/algs/qgis/Explode.py
  52. +1 −1 python/plugins/processing/algs/qgis/ExportGeometryInfo.py
  53. +2 −2 python/plugins/processing/algs/qgis/ExtentFromLayer.py
  54. +1 −1 python/plugins/processing/algs/qgis/ExtractByAttribute.py
  55. +2 −4 python/plugins/processing/algs/qgis/ExtractByLocation.py
  56. +3 −2 python/plugins/processing/algs/qgis/ExtractNodes.py
  57. +1 −1 python/plugins/processing/algs/qgis/FieldPyculator.py
  58. +1 −1 python/plugins/processing/algs/qgis/FieldsCalculator.py
  59. +2 −2 python/plugins/processing/algs/qgis/FixedDistanceBuffer.py
  60. +1 −1 python/plugins/processing/algs/qgis/GeometryConvert.py
  61. +3 −2 python/plugins/processing/algs/qgis/GridLine.py
  62. +3 −2 python/plugins/processing/algs/qgis/GridPolygon.py
  63. +1 −1 python/plugins/processing/algs/qgis/Gridify.py
  64. +3 −3 python/plugins/processing/algs/qgis/HubDistanceLines.py
  65. +3 −3 python/plugins/processing/algs/qgis/HubDistancePoints.py
  66. +3 −3 python/plugins/processing/algs/qgis/HubLines.py
  67. +2 −4 python/plugins/processing/algs/qgis/HypsometricCurves.py
  68. +2 −2 python/plugins/processing/algs/qgis/Intersection.py
  69. +1 −1 python/plugins/processing/algs/qgis/JoinAttributes.py
  70. +3 −3 python/plugins/processing/algs/qgis/LinesIntersection.py
  71. +3 −2 python/plugins/processing/algs/qgis/LinesToPolygons.py
  72. +2 −2 python/plugins/processing/algs/qgis/MeanCoords.py
  73. +3 −1 python/plugins/processing/algs/qgis/Merge.py
  74. +2 −2 python/plugins/processing/algs/qgis/MergeLines.py
  75. +1 −1 python/plugins/processing/algs/qgis/NearestNeighbourAnalysis.py
  76. +2 −2 python/plugins/processing/algs/qgis/OffsetLine.py
  77. +2 −2 python/plugins/processing/algs/qgis/OrientedMinimumBoundingBox.py
  78. +2 −2 python/plugins/processing/algs/qgis/PointDistance.py
  79. +2 −2 python/plugins/processing/algs/qgis/PointOnSurface.py
  80. +1 −1 python/plugins/processing/algs/qgis/PointsAlongGeometry.py
  81. +2 −2 python/plugins/processing/algs/qgis/PointsDisplacement.py
  82. +2 −2 python/plugins/processing/algs/qgis/PointsFromLines.py
  83. +2 −2 python/plugins/processing/algs/qgis/PointsFromPolygons.py
  84. +3 −3 python/plugins/processing/algs/qgis/PointsInPolygon.py
  85. +3 −3 python/plugins/processing/algs/qgis/PointsInPolygonUnique.py
  86. +3 −3 python/plugins/processing/algs/qgis/PointsInPolygonWeighted.py
  87. +1 −1 python/plugins/processing/algs/qgis/PointsLayerFromTable.py
  88. +2 −2 python/plugins/processing/algs/qgis/PointsToPaths.py
  89. +1 −1 python/plugins/processing/algs/qgis/PolygonCentroids.py
  90. +2 −2 python/plugins/processing/algs/qgis/Polygonize.py
  91. +2 −2 python/plugins/processing/algs/qgis/PolygonsToLines.py
  92. +1 −1 python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
  93. +1 −1 python/plugins/processing/algs/qgis/RandomExtract.py
  94. +1 −1 python/plugins/processing/algs/qgis/RandomExtractWithinSubsets.py
  95. +2 −2 python/plugins/processing/algs/qgis/RandomPointsAlongLines.py
  96. +2 −2 python/plugins/processing/algs/qgis/RandomPointsExtent.py
  97. +2 −2 python/plugins/processing/algs/qgis/RandomPointsLayer.py
  98. +2 −2 python/plugins/processing/algs/qgis/RandomPointsPolygonsFixed.py
  99. +2 −2 python/plugins/processing/algs/qgis/RandomPointsPolygonsVariable.py
  100. +1 −1 python/plugins/processing/algs/qgis/RandomSelection.py
  101. +1 −1 python/plugins/processing/algs/qgis/RandomSelectionWithinSubsets.py
  102. +2 −2 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsFixed.py
  103. +2 −2 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsVariable.py
  104. +2 −1 python/plugins/processing/algs/qgis/RegularPoints.py
  105. +1 −1 python/plugins/processing/algs/qgis/ReprojectLayer.py
  106. +2 −2 python/plugins/processing/algs/qgis/ReverseLineDirection.py
  107. +1 −1 python/plugins/processing/algs/qgis/SaveSelectedFeatures.py
  108. +1 −1 python/plugins/processing/algs/qgis/SelectByAttribute.py
  109. +4 −2 python/plugins/processing/algs/qgis/SelectByAttributeSum.py
  110. +3 −3 python/plugins/processing/algs/qgis/SelectByExpression.py
  111. +2 −4 python/plugins/processing/algs/qgis/SelectByLocation.py
  112. +1 −1 python/plugins/processing/algs/qgis/SetVectorStyle.py
  113. +1 −1 python/plugins/processing/algs/qgis/SimplifyGeometries.py
  114. +1 −1 python/plugins/processing/algs/qgis/SingleSidedBuffer.py
  115. +1 −1 python/plugins/processing/algs/qgis/Smooth.py
  116. +1 −2 python/plugins/processing/algs/qgis/SpatialIndex.py
  117. +2 −4 python/plugins/processing/algs/qgis/SpatialJoin.py
  118. +3 −3 python/plugins/processing/algs/qgis/SplitLinesWithLines.py
  119. +1 −1 python/plugins/processing/algs/qgis/StatisticsByCategories.py
  120. +3 −3 python/plugins/processing/algs/qgis/SumLines.py
  121. +2 −2 python/plugins/processing/algs/qgis/SymmetricalDifference.py
  122. +1 −1 python/plugins/processing/algs/qgis/TextToFloat.py
  123. +1 −1 python/plugins/processing/algs/qgis/Translate.py
  124. +2 −2 python/plugins/processing/algs/qgis/Union.py
  125. +1 −1 python/plugins/processing/algs/qgis/UniqueValues.py
  126. +2 −2 python/plugins/processing/algs/qgis/VariableDistanceBuffer.py
  127. +2 −1 python/plugins/processing/algs/qgis/VectorGridLines.py
  128. +2 −1 python/plugins/processing/algs/qgis/VectorGridPolygons.py
  129. +2 −3 python/plugins/processing/algs/qgis/VectorLayerHistogram.py
  130. +1 −1 python/plugins/processing/algs/qgis/VectorLayerScatterplot.py
  131. +1 −1 python/plugins/processing/algs/qgis/VectorSplit.py
  132. +2 −2 python/plugins/processing/algs/qgis/VoronoiPolygons.py
  133. +2 −2 python/plugins/processing/algs/qgis/ZonalStatistics.py
  134. +8 −7 python/plugins/processing/algs/r/RAlgorithm.py
  135. +6 −6 python/plugins/processing/algs/saga/SagaAlgorithm212.py
  136. +5 −5 python/plugins/processing/algs/saga/SagaAlgorithm213.py
  137. +3 −1 python/plugins/processing/algs/taudem/dinftranslimaccum.py
  138. +3 −1 python/plugins/processing/algs/taudem/dinftranslimaccum2.py
  139. +3 −2 python/plugins/processing/algs/taudem/dropanalysis.py
  140. +3 −1 python/plugins/processing/algs/taudem/gridnet.py
  141. +6 −18 python/plugins/processing/core/outputs.py
  142. +16 −42 python/plugins/processing/core/parameters.py
  143. +3 −3 python/plugins/processing/gui/AlgorithmDialog.py
  144. +2 −2 python/plugins/processing/gui/BatchInputSelectionPanel.py
  145. +7 −7 python/plugins/processing/gui/ParametersPanel.py
  146. +25 −24 python/plugins/processing/modeler/ModelerParametersDialog.py
  147. +12 −10 python/plugins/processing/script/ScriptAlgorithm.py
  148. +4 −3 python/plugins/processing/tests/ParametersTest.py
  149. +38 −3 python/plugins/processing/tools/dataobjects.py
@@ -69,7 +69,7 @@ def defineCharacteristics(self):
# We add the input vector layer. It can have any kind of geometry
# It is a mandatory (not optional) one, hence the False argument
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
self.addOutput(OutputVector(self.OUTPUT_LAYER,
@@ -79,7 +79,7 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Extraction')
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterVector(self.MASK, self.tr('Mask layer'),
[ParameterVector.VECTOR_TYPE_POLYGON]))
[dataobjects.TYPE_VECTOR_POLYGON]))
self.addParameter(ParameterString(self.NO_DATA,
self.tr("Nodata value, leave blank to take the nodata value from input"),
'', optional=True))
@@ -35,6 +35,7 @@
from processing.core.parameters import ParameterNumber
from processing.core.parameters import ParameterSelection
from processing.core.outputs import OutputRaster
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
@@ -64,7 +65,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Moving average)')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis')
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.tr('Z field'), self.INPUT,
ParameterTableField.DATA_TYPE_NUMBER, True))
@@ -35,8 +35,10 @@
from processing.core.parameters import ParameterSelection
from processing.core.parameters import ParameterNumber
from processing.core.outputs import OutputRaster
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils


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


@@ -68,7 +70,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Data metrics)')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis')
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.tr('Z field'), self.INPUT,
ParameterTableField.DATA_TYPE_NUMBER, True))
@@ -37,6 +37,7 @@
from processing.core.parameters import ParameterSelection
from processing.core.outputs import OutputRaster
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]

@@ -68,7 +69,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Inverse distance to a power)')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis')
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.tr('Z field'), self.INPUT,
ParameterTableField.DATA_TYPE_NUMBER, True))
@@ -36,6 +36,7 @@
from processing.core.parameters import ParameterNumber
from processing.core.parameters import ParameterSelection
from processing.core.outputs import OutputRaster
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
@@ -64,7 +65,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Grid (Nearest neighbor)')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Analysis')
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.tr('Z field'), self.INPUT,
ParameterTableField.DATA_TYPE_NUMBER, True))
@@ -36,6 +36,7 @@
from processing.core.parameters import ParameterSelection
from processing.algs.gdal.GdalUtils import GdalUtils
from processing.tools.system import tempFolder
from processing.tools import dataobjects

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

@@ -57,7 +58,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Build Virtual Raster')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous')
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.tr('Resolution'), self.RESOLUTION_OPTIONS, 0))
self.addParameter(ParameterBoolean(self.SEPARATE,
@@ -34,6 +34,7 @@
from processing.core.parameters import ParameterBoolean
from processing.core.parameters import ParameterMultipleInput
from processing.core.parameters import ParameterString
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
@@ -53,7 +54,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Tile Index')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous')
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.tr('Tile index field'),
'location', optional=True))
@@ -35,6 +35,7 @@
from processing.core.parameters import ParameterMultipleInput
from processing.core.parameters import ParameterSelection
from processing.tools.system import isWindows
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
@@ -57,7 +58,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Merge')
self.group, self.i18n_group = self.trAlgorithm('[GDAL] Miscellaneous')
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.tr('Grab pseudocolor table from first layer'), False))
self.addParameter(ParameterBoolean(merge.SEPARATE,
@@ -102,7 +102,7 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[OGR] Conversion')

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.tr('Destination Format'), FORMATS))
self.addParameter(ParameterString(self.OPTIONS,
@@ -34,6 +34,7 @@
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalUtils import GdalUtils

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

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

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.tr('Geometry column name ("geometry" for Shapefiles, may be different for other formats)'),
'geometry', optional=False))
@@ -70,7 +71,7 @@ def defineCharacteristics(self):
self.tr('Additional creation options (see ogr2ogr manual)'),
'', 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):
inLayer = self.getParameterValue(self.INPUT_LAYER)
@@ -32,6 +32,7 @@
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalUtils import GdalUtils

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

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

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.tr('Clip layer'), [ParameterVector.VECTOR_TYPE_POLYGON], False))
self.tr('Clip layer'), [dataobjects.TYPE_VECTOR_POLYGON]))
self.addParameter(ParameterString(self.OPTIONS,
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):
inLayer = self.getParameterValue(self.INPUT_LAYER)
@@ -49,7 +49,7 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('[OGR] Geoprocessing')

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.tr('Clip extent')))
self.addParameter(ParameterString(self.OPTIONS,
@@ -34,6 +34,7 @@
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalUtils import GdalUtils

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

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

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.tr('Geometry column name ("geometry" for Shapefiles, may be different for other formats)'),
'geometry', optional=False))
@@ -79,7 +80,7 @@ def defineCharacteristics(self):
self.tr('Additional creation options (see ogr2ogr manual)'),
'', 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):
inLayer = self.getParameterValue(self.INPUT_LAYER)
@@ -35,6 +35,7 @@
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalUtils import GdalUtils

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

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

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.tr('Operation'), self.OPERATIONLIST, 0))
self.addParameter(ParameterString(self.GEOMETRY,
@@ -33,6 +33,7 @@
from processing.algs.gdal.GdalAlgorithm import GdalAlgorithm
from processing.algs.gdal.GdalUtils import GdalUtils

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

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

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.tr('Geometry column name ("geometry" for Shapefiles, may be different for other formats)'),
'geometry', optional=False))
@@ -60,7 +61,7 @@ def defineCharacteristics(self):
self.tr('Additional creation options (see ogr2ogr manual)'),
'', 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):
inLayer = self.getParameterValue(self.INPUT_LAYER)
@@ -81,7 +81,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Import Vector into PostGIS database (new connection)')
self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous')
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.tr('Shape encoding'), "", optional=True))
self.addParameter(ParameterSelection(self.GTYPE,
@@ -98,7 +98,7 @@ def defineCharacteristics(self):
self.addParameter(ParameterSelection(self.DATABASE,
self.tr('Database (connection name)'), self.DB_CONNECTIONS))
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.tr('Shape encoding'), "", optional=True))
self.addParameter(ParameterSelection(self.GTYPE,
@@ -47,8 +47,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Information')
self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous')

self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer'),
[ParameterVector.VECTOR_TYPE_ANY], False))
self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterBoolean(self.SUMMARY_ONLY,
self.tr('Summary output only'),
True))
@@ -51,8 +51,7 @@ def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Execute SQL')
self.group, self.i18n_group = self.trAlgorithm('[OGR] Miscellaneous')

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

self.addParameter(ParameterSelection(
@@ -34,6 +34,7 @@
from processing.core.parameters import ParameterBoolean
from processing.core.outputs import OutputDirectory
from processing.tools.system import isWindows
from processing.tools import dataobjects
from processing.algs.gdal.GdalUtils import GdalUtils
import re

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

0 comments on commit 65db336

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