Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
66 changes: 38 additions & 28 deletions python/core/processing/qgsprocessingparameters.sip
Expand Up @@ -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
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/AddTableField.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/Aggregate.py
Expand Up @@ -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'
Expand Down
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/BasicStatistics.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/Boundary.py
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/BoundingBox.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/CheckValidity.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/ConcaveHull.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/ConvexHull.py
Expand Up @@ -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__()
Expand Down
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/Datasources2Vrt.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/DefineProjection.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/Delaunay.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/DeleteColumn.py
Expand Up @@ -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__()
Expand Down
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/DeleteHoles.py
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/DensifyGeometries.py
Expand Up @@ -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__()
Expand Down
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/Difference.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/DropGeometry.py
Expand Up @@ -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__()
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/DropMZValues.py
Expand Up @@ -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__()
Expand All @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/EliminateSelection.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/EquivalentNumField.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/ExecuteSQL.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/Explode.py
Expand Up @@ -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__()
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/algs/qgis/ExportGeometryInfo.py
Expand Up @@ -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__()
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/ExtendLines.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/ExtentFromLayer.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/ExtractByLocation.py
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/ExtractNodes.py
Expand Up @@ -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__()
Expand Down
Expand Up @@ -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__()
Expand Down

0 comments on commit 8a2cf3f

Please sign in to comment.