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 8a2cf3f
Show file tree
Hide file tree
Showing 130 changed files with 509 additions and 251 deletions.
@@ -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):