Skip to content
Permalink
Browse files

Merge pull request #5058 from nyalldawson/processing_fixes

Processing polish
  • Loading branch information
nyalldawson committed Aug 23, 2017
2 parents ef89a62 + 0669167 commit 8a2cf3f709cdd757975c7863e717174b391e7fa6
Showing with 509 additions and 251 deletions.
  1. +38 −28 python/core/processing/qgsprocessingparameters.sip
  2. +1 −1 python/plugins/processing/algs/qgis/AddTableField.py
  3. +1 −1 python/plugins/processing/algs/qgis/Aggregate.py
  4. +1 −1 python/plugins/processing/algs/qgis/AutoincrementalField.py
  5. +1 −1 python/plugins/processing/algs/qgis/BasicStatistics.py
  6. +1 −1 python/plugins/processing/algs/qgis/Boundary.py
  7. +1 −1 python/plugins/processing/algs/qgis/BoundingBox.py
  8. +1 −1 python/plugins/processing/algs/qgis/CheckValidity.py
  9. +1 −1 python/plugins/processing/algs/qgis/ConcaveHull.py
  10. +1 −1 python/plugins/processing/algs/qgis/ConvexHull.py
  11. +1 −1 python/plugins/processing/algs/qgis/CreateAttributeIndex.py
  12. +1 −1 python/plugins/processing/algs/qgis/Datasources2Vrt.py
  13. +1 −1 python/plugins/processing/algs/qgis/DefineProjection.py
  14. +1 −1 python/plugins/processing/algs/qgis/Delaunay.py
  15. +1 −1 python/plugins/processing/algs/qgis/DeleteColumn.py
  16. +1 −1 python/plugins/processing/algs/qgis/DeleteDuplicateGeometries.py
  17. +1 −1 python/plugins/processing/algs/qgis/DeleteHoles.py
  18. +1 −1 python/plugins/processing/algs/qgis/DensifyGeometries.py
  19. +1 −1 python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py
  20. +1 −1 python/plugins/processing/algs/qgis/Difference.py
  21. +1 −1 python/plugins/processing/algs/qgis/DropGeometry.py
  22. +2 −2 python/plugins/processing/algs/qgis/DropMZValues.py
  23. +1 −1 python/plugins/processing/algs/qgis/EliminateSelection.py
  24. +1 −1 python/plugins/processing/algs/qgis/EquivalentNumField.py
  25. +1 −1 python/plugins/processing/algs/qgis/ExecuteSQL.py
  26. +1 −1 python/plugins/processing/algs/qgis/Explode.py
  27. +3 −3 python/plugins/processing/algs/qgis/ExportGeometryInfo.py
  28. +1 −1 python/plugins/processing/algs/qgis/ExtendLines.py
  29. +1 −1 python/plugins/processing/algs/qgis/ExtentFromLayer.py
  30. +1 −1 python/plugins/processing/algs/qgis/ExtractByLocation.py
  31. +1 −1 python/plugins/processing/algs/qgis/ExtractNodes.py
  32. +1 −1 python/plugins/processing/algs/qgis/ExtractSpecificNodes.py
  33. +1 −1 python/plugins/processing/algs/qgis/FieldPyculator.py
  34. +1 −1 python/plugins/processing/algs/qgis/FieldsCalculator.py
  35. +1 −1 python/plugins/processing/algs/qgis/FieldsMapper.py
  36. +1 −1 python/plugins/processing/algs/qgis/FindProjection.py
  37. +1 −1 python/plugins/processing/algs/qgis/FixGeometry.py
  38. +1 −1 python/plugins/processing/algs/qgis/FixedDistanceBuffer.py
  39. +1 −1 python/plugins/processing/algs/qgis/GeometryByExpression.py
  40. +1 −1 python/plugins/processing/algs/qgis/GeometryConvert.py
  41. +1 −1 python/plugins/processing/algs/qgis/GridLine.py
  42. +1 −1 python/plugins/processing/algs/qgis/GridPolygon.py
  43. +1 −1 python/plugins/processing/algs/qgis/Gridify.py
  44. +1 −1 python/plugins/processing/algs/qgis/HubDistanceLines.py
  45. +1 −1 python/plugins/processing/algs/qgis/HubDistancePoints.py
  46. +1 −1 python/plugins/processing/algs/qgis/HubLines.py
  47. +1 −1 python/plugins/processing/algs/qgis/HypsometricCurves.py
  48. +1 −1 python/plugins/processing/algs/qgis/Intersection.py
  49. +1 −1 python/plugins/processing/algs/qgis/JoinAttributes.py
  50. +1 −1 python/plugins/processing/algs/qgis/LinesIntersection.py
  51. +1 −1 python/plugins/processing/algs/qgis/LinesToPolygons.py
  52. +1 −1 python/plugins/processing/algs/qgis/MeanCoords.py
  53. +1 −1 python/plugins/processing/algs/qgis/Merge.py
  54. +1 −1 python/plugins/processing/algs/qgis/MergeLines.py
  55. +1 −1 python/plugins/processing/algs/qgis/NearestNeighbourAnalysis.py
  56. +1 −1 python/plugins/processing/algs/qgis/OffsetLine.py
  57. +1 −1 python/plugins/processing/algs/qgis/OrientedMinimumBoundingBox.py
  58. +1 −1 python/plugins/processing/algs/qgis/Orthogonalize.py
  59. +1 −1 python/plugins/processing/algs/qgis/PointDistance.py
  60. +1 −1 python/plugins/processing/algs/qgis/PointOnSurface.py
  61. +1 −1 python/plugins/processing/algs/qgis/PointsAlongGeometry.py
  62. +1 −1 python/plugins/processing/algs/qgis/PointsDisplacement.py
  63. +1 −1 python/plugins/processing/algs/qgis/PointsFromLines.py
  64. +1 −1 python/plugins/processing/algs/qgis/PointsFromPolygons.py
  65. +1 −1 python/plugins/processing/algs/qgis/PointsInPolygon.py
  66. +1 −7 python/plugins/processing/algs/qgis/PointsLayerFromTable.py
  67. +1 −1 python/plugins/processing/algs/qgis/PointsToPaths.py
  68. +2 −2 python/plugins/processing/algs/qgis/PoleOfInaccessibility.py
  69. +1 −1 python/plugins/processing/algs/qgis/Polygonize.py
  70. +1 −1 python/plugins/processing/algs/qgis/PolygonsToLines.py
  71. +1 −1 python/plugins/processing/algs/qgis/RandomExtract.py
  72. +1 −1 python/plugins/processing/algs/qgis/RandomExtractWithinSubsets.py
  73. +1 −1 python/plugins/processing/algs/qgis/RandomPointsAlongLines.py
  74. +1 −1 python/plugins/processing/algs/qgis/RandomPointsExtent.py
  75. +1 −1 python/plugins/processing/algs/qgis/RandomPointsLayer.py
  76. +1 −1 python/plugins/processing/algs/qgis/RandomPointsPolygons.py
  77. +1 −1 python/plugins/processing/algs/qgis/RandomSelection.py
  78. +1 −1 python/plugins/processing/algs/qgis/RandomSelectionWithinSubsets.py
  79. +1 −1 python/plugins/processing/algs/qgis/RasterCalculator.py
  80. +1 −1 python/plugins/processing/algs/qgis/RasterLayerStatistics.py
  81. +1 −1 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsFixed.py
  82. +1 −1 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsVariable.py
  83. +1 −1 python/plugins/processing/algs/qgis/RegularPoints.py
  84. +1 −1 python/plugins/processing/algs/qgis/ReverseLineDirection.py
  85. +1 −1 python/plugins/processing/algs/qgis/SaveSelectedFeatures.py
  86. +1 −1 python/plugins/processing/algs/qgis/SelectByAttribute.py
  87. +1 −1 python/plugins/processing/algs/qgis/SelectByAttributeSum.py
  88. +1 −1 python/plugins/processing/algs/qgis/SelectByExpression.py
  89. +1 −1 python/plugins/processing/algs/qgis/SelectByLocation.py
  90. +2 −2 python/plugins/processing/algs/qgis/SetMValue.py
  91. +1 −1 python/plugins/processing/algs/qgis/SetRasterStyle.py
  92. +1 −1 python/plugins/processing/algs/qgis/SetVectorStyle.py
  93. +2 −2 python/plugins/processing/algs/qgis/SetZValue.py
  94. +1 −1 python/plugins/processing/algs/qgis/SimplifyGeometries.py
  95. +1 −1 python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py
  96. +1 −1 python/plugins/processing/algs/qgis/SingleSidedBuffer.py
  97. +1 −1 python/plugins/processing/algs/qgis/Smooth.py
  98. +1 −1 python/plugins/processing/algs/qgis/SnapGeometries.py
  99. +1 −1 python/plugins/processing/algs/qgis/SpatialIndex.py
  100. +1 −1 python/plugins/processing/algs/qgis/SpatialJoin.py
  101. +1 −1 python/plugins/processing/algs/qgis/SplitWithLines.py
  102. +1 −1 python/plugins/processing/algs/qgis/StatisticsByCategories.py
  103. +1 −1 python/plugins/processing/algs/qgis/SumLines.py
  104. +1 −1 python/plugins/processing/algs/qgis/SymmetricalDifference.py
  105. +1 −1 python/plugins/processing/algs/qgis/TextToFloat.py
  106. +1 −1 python/plugins/processing/algs/qgis/TopoColors.py
  107. +1 −1 python/plugins/processing/algs/qgis/Translate.py
  108. +1 −1 python/plugins/processing/algs/qgis/TruncateTable.py
  109. +1 −1 python/plugins/processing/algs/qgis/Union.py
  110. +1 −1 python/plugins/processing/algs/qgis/UniqueValues.py
  111. +1 −1 python/plugins/processing/algs/qgis/VariableDistanceBuffer.py
  112. +1 −1 python/plugins/processing/algs/qgis/VectorSplit.py
  113. +1 −1 python/plugins/processing/algs/qgis/VoronoiPolygons.py
  114. +2 −2 python/plugins/processing/algs/qgis/ZonalStatistics.py
  115. +1 −1 python/plugins/processing/algs/qgis/scripts/Frequency_analysis.py
  116. +1 −1 python/plugins/processing/algs/qgis/scripts/Keep_n_biggest_parts.py
  117. +1 −1 python/plugins/processing/algs/qgis/scripts/Number_of_unique_values_in_classes.py
  118. +2 −2 python/plugins/processing/algs/saga/SagaNameDecorator.py
  119. +8 −4 python/plugins/processing/gui/ExtentSelectionPanel.py
  120. +8 −4 python/plugins/processing/gui/PointSelectionPanel.py
  121. +2 −2 python/plugins/processing/gui/ProcessingToolbox.py
  122. +49 −14 python/plugins/processing/gui/wrappers.py
  123. +2 −0 python/plugins/processing/modeler/ModelerDialog.py
  124. +20 −8 python/plugins/processing/modeler/ModelerParametersDialog.py
  125. +79 −0 python/plugins/processing/tests/GuiTest.py
  126. +14 −5 src/core/processing/models/qgsprocessingmodelalgorithm.cpp
  127. +10 −10 src/core/processing/qgsnativealgorithms.h
  128. +6 −10 src/core/processing/qgsprocessingparameters.cpp
  129. +37 −35 src/core/processing/qgsprocessingparameters.h
  130. +111 −0 tests/src/core/testqgsprocessing.cpp
@@ -1420,7 +1420,42 @@ class QgsProcessingParameterExpression : QgsProcessingParameterDefinition

};

class QgsProcessingParameterVectorLayer : QgsProcessingParameterDefinition

class QgsProcessingParameterLimitedDataTypes
{
%Docstring
Can be inherited by parameters which require limits to their acceptable data types.
.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:

QgsProcessingParameterLimitedDataTypes( const QList< int > &types = QList< int >() );
%Docstring
Constructor for QgsProcessingParameterLimitedDataTypes, with a list of acceptable data ``types``.
%End

QList< int > dataTypes() const;
%Docstring
Returns the geometry types for sources acceptable by the parameter.
.. seealso:: setDataTypes()
:rtype: list of int
%End

void setDataTypes( const QList< int > &types );
%Docstring
Sets the geometry ``types`` for sources acceptable by the parameter.
.. seealso:: dataTypes()
%End

protected:

};

class QgsProcessingParameterVectorLayer : QgsProcessingParameterDefinition, QgsProcessingParameterLimitedDataTypes
{
%Docstring
A vector layer (with or without geometry) parameter for processing algorithms. Consider using
@@ -1455,19 +1490,6 @@ class QgsProcessingParameterVectorLayer : QgsProcessingParameterDefinition
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;


QList< int > dataTypes() const;
%Docstring
Returns the geometry types for sources acceptable by the parameter.
.. seealso:: setDataTypes()
:rtype: list of int
%End

void setDataTypes( const QList< int > &types );
%Docstring
Sets the geometry ``types`` for sources acceptable by the parameter.
.. seealso:: dataTypes()
%End

virtual QVariantMap toVariantMap() const;

virtual bool fromVariantMap( const QVariantMap &map );
@@ -1579,7 +1601,8 @@ class QgsProcessingParameterField : QgsProcessingParameterDefinition

};

class QgsProcessingParameterFeatureSource : QgsProcessingParameterDefinition

class QgsProcessingParameterFeatureSource : QgsProcessingParameterDefinition, QgsProcessingParameterLimitedDataTypes
{
%Docstring
An input feature source (such as vector layers) parameter for processing algorithms.
@@ -1613,19 +1636,6 @@ class QgsProcessingParameterFeatureSource : QgsProcessingParameterDefinition
virtual QString asScriptCode() const;


QList< int > dataTypes() const;
%Docstring
Returns the geometry types for sources acceptable by the parameter.
.. seealso:: setDataTypes()
:rtype: list of int
%End

void setDataTypes( const QList< int > &types );
%Docstring
Sets the geometry ``types`` for sources acceptable by the parameter.
.. seealso:: dataTypes()
%End

virtual QVariantMap toVariantMap() const;

virtual bool fromVariantMap( const QVariantMap &map );
@@ -43,7 +43,7 @@ class AddTableField(QgisFeatureBasedAlgorithm):
TYPES = [QVariant.Int, QVariant.Double, QVariant.String]

def group(self):
return self.tr('Vector table tools')
return self.tr('Vector table')

def __init__(self):
super().__init__()
@@ -55,7 +55,7 @@ class Aggregate(QgisAlgorithm):
OUTPUT = 'OUTPUT'

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def name(self):
return 'aggregate'
@@ -37,7 +37,7 @@ def __init__(self):
self.current = 0

def group(self):
return self.tr('Vector table tools')
return self.tr('Vector table')

def name(self):
return 'addautoincrementalfield'
@@ -81,7 +81,7 @@ def tags(self):
'count,distinct,unique,variance,median,quartile,range,majority,minority').split(',')

def group(self):
return self.tr('Vector table tools')
return self.tr('Vector analysis')

def __init__(self):
super().__init__()
@@ -46,7 +46,7 @@ def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'convex_hull.png'))

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def name(self):
return 'boundary'
@@ -45,7 +45,7 @@ def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'matrix.png'))

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -66,7 +66,7 @@ def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'check_geometry.png'))

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -50,7 +50,7 @@ class ConcaveHull(QgisAlgorithm):
OUTPUT = 'OUTPUT'

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -61,7 +61,7 @@ def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'convex_hull.png'))

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -41,7 +41,7 @@ class CreateAttributeIndex(QgisAlgorithm):
OUTPUT = 'OUTPUT'

def group(self):
return self.tr('Vector general tools')
return self.tr('Vector general')

def __init__(self):
super().__init__()
@@ -48,7 +48,7 @@ class Datasources2Vrt(QgisAlgorithm):
VRT_STRING = 'VRT_STRING'

def group(self):
return self.tr('Vector general tools')
return self.tr('Vector general')

def __init__(self):
super().__init__()
@@ -44,7 +44,7 @@ class DefineProjection(QgisAlgorithm):
CRS = 'CRS'

def group(self):
return self.tr('Vector general tools')
return self.tr('Vector general')

def __init__(self):
super().__init__()
@@ -60,7 +60,7 @@ def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'delaunay.png'))

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -37,7 +37,7 @@ def tags(self):
return self.tr('drop,delete,remove,fields,columns,attributes').split(',')

def group(self):
return self.tr('Vector table tools')
return self.tr('Vector table')

def __init__(self):
super().__init__()
@@ -38,7 +38,7 @@ class DeleteDuplicateGeometries(QgisAlgorithm):
OUTPUT = 'OUTPUT'

def group(self):
return self.tr('Vector general tools')
return self.tr('Vector general')

def __init__(self):
super().__init__()
@@ -45,7 +45,7 @@ def tags(self):
return self.tr('remove,delete,drop,holes,rings,fill').split(',')

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def name(self):
return 'deleteholes'
@@ -41,7 +41,7 @@ def tags(self):
return self.tr('add,vertices,points').split(',')

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -37,7 +37,7 @@ class DensifyGeometriesInterval(QgisFeatureBasedAlgorithm):
INTERVAL = 'INTERVAL'

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -52,7 +52,7 @@ def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'difference.png'))

def group(self):
return self.tr('Vector overlay tools')
return self.tr('Vector overlay')

def __init__(self):
super().__init__()
@@ -37,7 +37,7 @@ def tags(self):
return self.tr('remove,drop,delete,geometry,objects').split(',')

def group(self):
return self.tr('Vector general tools')
return self.tr('Vector general')

def __init__(self):
super().__init__()
@@ -43,7 +43,7 @@ class DropMZValues(QgisFeatureBasedAlgorithm):
DROP_Z_VALUES = 'DROP_Z_VALUES'

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -54,7 +54,7 @@ def name(self):
return 'dropmzvalues'

def displayName(self):
return self.tr('Drop M/Z Values')
return self.tr('Drop M/Z values')

def outputName(self):
return self.tr('Z/M Dropped')
@@ -60,7 +60,7 @@ def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'eliminate.png'))

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -41,7 +41,7 @@ class EquivalentNumField(QgisAlgorithm):
FIELD = 'FIELD'

def group(self):
return self.tr('Vector table tools')
return self.tr('Vector table')

def __init__(self):
super().__init__()
@@ -54,7 +54,7 @@ class ExecuteSQL(QgisAlgorithm):
OUTPUT = 'OUTPUT'

def group(self):
return self.tr('Vector general tools')
return self.tr('Vector general')

def __init__(self):
super().__init__()
@@ -43,7 +43,7 @@ class Explode(QgisAlgorithm):
OUTPUT = 'OUTPUT'

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -55,10 +55,10 @@ def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'export_geometry.png'))

def tags(self):
return self.tr('export,measurements,areas,lengths,perimeters,latitudes,longitudes,x,y,z,extract,points,lines,polygons').split(',')
return self.tr('export,add,information,measurements,areas,lengths,perimeters,latitudes,longitudes,x,y,z,extract,points,lines,polygons').split(',')

def group(self):
return self.tr('Vector table tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -80,7 +80,7 @@ def name(self):
return 'exportaddgeometrycolumns'

def displayName(self):
return self.tr('Export/Add geometry columns')
return self.tr('Export geometry columns')

def processAlgorithm(self, parameters, context, feedback):
source = self.parameterAsSource(parameters, self.INPUT, context)
@@ -36,7 +36,7 @@ class ExtendLines(QgisFeatureBasedAlgorithm):
END_DISTANCE = 'END_DISTANCE'

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -61,7 +61,7 @@ def tags(self):
return self.tr('extent,envelope,bounds,bounding,boundary,layer').split(',')

def group(self):
return self.tr('Vector general tools')
return self.tr('Vector general')

def __init__(self):
super().__init__()
@@ -49,7 +49,7 @@ def tags(self):
return self.tr('extract,filter,location,intersects,contains,within').split(',')

def group(self):
return self.tr('Vector selection tools')
return self.tr('Vector selection')

def __init__(self):
super().__init__()
@@ -54,7 +54,7 @@ def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'extract_nodes.png'))

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()
@@ -47,7 +47,7 @@ class ExtractSpecificNodes(QgisAlgorithm):
NODES = 'NODES'

def group(self):
return self.tr('Vector geometry tools')
return self.tr('Vector geometry')

def __init__(self):
super().__init__()

0 comments on commit 8a2cf3f

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