Skip to content

Commit 8a2cf3f

Browse files
authored
Merge pull request #5058 from nyalldawson/processing_fixes
Processing polish
2 parents ef89a62 + 0669167 commit 8a2cf3f

File tree

130 files changed

+509
-251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+509
-251
lines changed

python/core/processing/qgsprocessingparameters.sip

+38-28
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,42 @@ class QgsProcessingParameterExpression : QgsProcessingParameterDefinition
14201420

14211421
};
14221422

1423-
class QgsProcessingParameterVectorLayer : QgsProcessingParameterDefinition
1423+
1424+
class QgsProcessingParameterLimitedDataTypes
1425+
{
1426+
%Docstring
1427+
Can be inherited by parameters which require limits to their acceptable data types.
1428+
.. versionadded:: 3.0
1429+
%End
1430+
1431+
%TypeHeaderCode
1432+
#include "qgsprocessingparameters.h"
1433+
%End
1434+
public:
1435+
1436+
QgsProcessingParameterLimitedDataTypes( const QList< int > &types = QList< int >() );
1437+
%Docstring
1438+
Constructor for QgsProcessingParameterLimitedDataTypes, with a list of acceptable data ``types``.
1439+
%End
1440+
1441+
QList< int > dataTypes() const;
1442+
%Docstring
1443+
Returns the geometry types for sources acceptable by the parameter.
1444+
.. seealso:: setDataTypes()
1445+
:rtype: list of int
1446+
%End
1447+
1448+
void setDataTypes( const QList< int > &types );
1449+
%Docstring
1450+
Sets the geometry ``types`` for sources acceptable by the parameter.
1451+
.. seealso:: dataTypes()
1452+
%End
1453+
1454+
protected:
1455+
1456+
};
1457+
1458+
class QgsProcessingParameterVectorLayer : QgsProcessingParameterDefinition, QgsProcessingParameterLimitedDataTypes
14241459
{
14251460
%Docstring
14261461
A vector layer (with or without geometry) parameter for processing algorithms. Consider using
@@ -1455,19 +1490,6 @@ class QgsProcessingParameterVectorLayer : QgsProcessingParameterDefinition
14551490
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
14561491

14571492

1458-
QList< int > dataTypes() const;
1459-
%Docstring
1460-
Returns the geometry types for sources acceptable by the parameter.
1461-
.. seealso:: setDataTypes()
1462-
:rtype: list of int
1463-
%End
1464-
1465-
void setDataTypes( const QList< int > &types );
1466-
%Docstring
1467-
Sets the geometry ``types`` for sources acceptable by the parameter.
1468-
.. seealso:: dataTypes()
1469-
%End
1470-
14711493
virtual QVariantMap toVariantMap() const;
14721494

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

15801602
};
15811603

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

16151638

1616-
QList< int > dataTypes() const;
1617-
%Docstring
1618-
Returns the geometry types for sources acceptable by the parameter.
1619-
.. seealso:: setDataTypes()
1620-
:rtype: list of int
1621-
%End
1622-
1623-
void setDataTypes( const QList< int > &types );
1624-
%Docstring
1625-
Sets the geometry ``types`` for sources acceptable by the parameter.
1626-
.. seealso:: dataTypes()
1627-
%End
1628-
16291639
virtual QVariantMap toVariantMap() const;
16301640

16311641
virtual bool fromVariantMap( const QVariantMap &map );

python/plugins/processing/algs/qgis/AddTableField.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class AddTableField(QgisFeatureBasedAlgorithm):
4343
TYPES = [QVariant.Int, QVariant.Double, QVariant.String]
4444

4545
def group(self):
46-
return self.tr('Vector table tools')
46+
return self.tr('Vector table')
4747

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

python/plugins/processing/algs/qgis/Aggregate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Aggregate(QgisAlgorithm):
5555
OUTPUT = 'OUTPUT'
5656

5757
def group(self):
58-
return self.tr('Vector geometry tools')
58+
return self.tr('Vector geometry')
5959

6060
def name(self):
6161
return 'aggregate'

python/plugins/processing/algs/qgis/AutoincrementalField.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self):
3737
self.current = 0
3838

3939
def group(self):
40-
return self.tr('Vector table tools')
40+
return self.tr('Vector table')
4141

4242
def name(self):
4343
return 'addautoincrementalfield'

python/plugins/processing/algs/qgis/BasicStatistics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def tags(self):
8181
'count,distinct,unique,variance,median,quartile,range,majority,minority').split(',')
8282

8383
def group(self):
84-
return self.tr('Vector table tools')
84+
return self.tr('Vector analysis')
8585

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

python/plugins/processing/algs/qgis/Boundary.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def icon(self):
4646
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'convex_hull.png'))
4747

4848
def group(self):
49-
return self.tr('Vector geometry tools')
49+
return self.tr('Vector geometry')
5050

5151
def name(self):
5252
return 'boundary'

python/plugins/processing/algs/qgis/BoundingBox.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def icon(self):
4545
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'matrix.png'))
4646

4747
def group(self):
48-
return self.tr('Vector geometry tools')
48+
return self.tr('Vector geometry')
4949

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

python/plugins/processing/algs/qgis/CheckValidity.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def icon(self):
6666
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'check_geometry.png'))
6767

6868
def group(self):
69-
return self.tr('Vector geometry tools')
69+
return self.tr('Vector geometry')
7070

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

python/plugins/processing/algs/qgis/ConcaveHull.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ConcaveHull(QgisAlgorithm):
5050
OUTPUT = 'OUTPUT'
5151

5252
def group(self):
53-
return self.tr('Vector geometry tools')
53+
return self.tr('Vector geometry')
5454

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

python/plugins/processing/algs/qgis/ConvexHull.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def icon(self):
6161
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'convex_hull.png'))
6262

6363
def group(self):
64-
return self.tr('Vector geometry tools')
64+
return self.tr('Vector geometry')
6565

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

python/plugins/processing/algs/qgis/CreateAttributeIndex.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class CreateAttributeIndex(QgisAlgorithm):
4141
OUTPUT = 'OUTPUT'
4242

4343
def group(self):
44-
return self.tr('Vector general tools')
44+
return self.tr('Vector general')
4545

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

python/plugins/processing/algs/qgis/Datasources2Vrt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Datasources2Vrt(QgisAlgorithm):
4848
VRT_STRING = 'VRT_STRING'
4949

5050
def group(self):
51-
return self.tr('Vector general tools')
51+
return self.tr('Vector general')
5252

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

python/plugins/processing/algs/qgis/DefineProjection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class DefineProjection(QgisAlgorithm):
4444
CRS = 'CRS'
4545

4646
def group(self):
47-
return self.tr('Vector general tools')
47+
return self.tr('Vector general')
4848

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

python/plugins/processing/algs/qgis/Delaunay.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def icon(self):
6060
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'delaunay.png'))
6161

6262
def group(self):
63-
return self.tr('Vector geometry tools')
63+
return self.tr('Vector geometry')
6464

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

python/plugins/processing/algs/qgis/DeleteColumn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def tags(self):
3737
return self.tr('drop,delete,remove,fields,columns,attributes').split(',')
3838

3939
def group(self):
40-
return self.tr('Vector table tools')
40+
return self.tr('Vector table')
4141

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

python/plugins/processing/algs/qgis/DeleteDuplicateGeometries.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class DeleteDuplicateGeometries(QgisAlgorithm):
3838
OUTPUT = 'OUTPUT'
3939

4040
def group(self):
41-
return self.tr('Vector general tools')
41+
return self.tr('Vector general')
4242

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

python/plugins/processing/algs/qgis/DeleteHoles.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def tags(self):
4545
return self.tr('remove,delete,drop,holes,rings,fill').split(',')
4646

4747
def group(self):
48-
return self.tr('Vector geometry tools')
48+
return self.tr('Vector geometry')
4949

5050
def name(self):
5151
return 'deleteholes'

python/plugins/processing/algs/qgis/DensifyGeometries.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def tags(self):
4141
return self.tr('add,vertices,points').split(',')
4242

4343
def group(self):
44-
return self.tr('Vector geometry tools')
44+
return self.tr('Vector geometry')
4545

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

python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class DensifyGeometriesInterval(QgisFeatureBasedAlgorithm):
3737
INTERVAL = 'INTERVAL'
3838

3939
def group(self):
40-
return self.tr('Vector geometry tools')
40+
return self.tr('Vector geometry')
4141

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

python/plugins/processing/algs/qgis/Difference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def icon(self):
5252
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'difference.png'))
5353

5454
def group(self):
55-
return self.tr('Vector overlay tools')
55+
return self.tr('Vector overlay')
5656

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

python/plugins/processing/algs/qgis/DropGeometry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def tags(self):
3737
return self.tr('remove,drop,delete,geometry,objects').split(',')
3838

3939
def group(self):
40-
return self.tr('Vector general tools')
40+
return self.tr('Vector general')
4141

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

python/plugins/processing/algs/qgis/DropMZValues.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class DropMZValues(QgisFeatureBasedAlgorithm):
4343
DROP_Z_VALUES = 'DROP_Z_VALUES'
4444

4545
def group(self):
46-
return self.tr('Vector geometry tools')
46+
return self.tr('Vector geometry')
4747

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

5656
def displayName(self):
57-
return self.tr('Drop M/Z Values')
57+
return self.tr('Drop M/Z values')
5858

5959
def outputName(self):
6060
return self.tr('Z/M Dropped')

python/plugins/processing/algs/qgis/EliminateSelection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def icon(self):
6060
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'eliminate.png'))
6161

6262
def group(self):
63-
return self.tr('Vector geometry tools')
63+
return self.tr('Vector geometry')
6464

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

python/plugins/processing/algs/qgis/EquivalentNumField.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class EquivalentNumField(QgisAlgorithm):
4141
FIELD = 'FIELD'
4242

4343
def group(self):
44-
return self.tr('Vector table tools')
44+
return self.tr('Vector table')
4545

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

python/plugins/processing/algs/qgis/ExecuteSQL.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class ExecuteSQL(QgisAlgorithm):
5454
OUTPUT = 'OUTPUT'
5555

5656
def group(self):
57-
return self.tr('Vector general tools')
57+
return self.tr('Vector general')
5858

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

python/plugins/processing/algs/qgis/Explode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Explode(QgisAlgorithm):
4343
OUTPUT = 'OUTPUT'
4444

4545
def group(self):
46-
return self.tr('Vector geometry tools')
46+
return self.tr('Vector geometry')
4747

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

python/plugins/processing/algs/qgis/ExportGeometryInfo.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ def icon(self):
5555
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'export_geometry.png'))
5656

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

6060
def group(self):
61-
return self.tr('Vector table tools')
61+
return self.tr('Vector geometry')
6262

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

8282
def displayName(self):
83-
return self.tr('Export/Add geometry columns')
83+
return self.tr('Export geometry columns')
8484

8585
def processAlgorithm(self, parameters, context, feedback):
8686
source = self.parameterAsSource(parameters, self.INPUT, context)

python/plugins/processing/algs/qgis/ExtendLines.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ExtendLines(QgisFeatureBasedAlgorithm):
3636
END_DISTANCE = 'END_DISTANCE'
3737

3838
def group(self):
39-
return self.tr('Vector geometry tools')
39+
return self.tr('Vector geometry')
4040

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

python/plugins/processing/algs/qgis/ExtentFromLayer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def tags(self):
6161
return self.tr('extent,envelope,bounds,bounding,boundary,layer').split(',')
6262

6363
def group(self):
64-
return self.tr('Vector general tools')
64+
return self.tr('Vector general')
6565

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

python/plugins/processing/algs/qgis/ExtractByLocation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def tags(self):
4949
return self.tr('extract,filter,location,intersects,contains,within').split(',')
5050

5151
def group(self):
52-
return self.tr('Vector selection tools')
52+
return self.tr('Vector selection')
5353

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

python/plugins/processing/algs/qgis/ExtractNodes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def icon(self):
5454
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'extract_nodes.png'))
5555

5656
def group(self):
57-
return self.tr('Vector geometry tools')
57+
return self.tr('Vector geometry')
5858

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

python/plugins/processing/algs/qgis/ExtractSpecificNodes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ExtractSpecificNodes(QgisAlgorithm):
4747
NODES = 'NODES'
4848

4949
def group(self):
50-
return self.tr('Vector geometry tools')
50+
return self.tr('Vector geometry')
5151

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

0 commit comments

Comments
 (0)