Skip to content

Commit

Permalink
[processing] Create Attribute Index can run on non-spatial layers
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 15, 2018
1 parent 483b4ff commit 0383a14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/qgis/CreateAttributeIndex.py
Expand Up @@ -27,6 +27,7 @@

from qgis.core import (QgsVectorDataProvider,
QgsFields,
QgsProcessing,
QgsProcessingAlgorithm,
QgsProcessingParameterVectorLayer,
QgsProcessingParameterField,
Expand All @@ -52,7 +53,8 @@ def __init__(self):

def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterVectorLayer(self.INPUT,
self.tr('Input Layer')))
self.tr('Input Layer'),
types=[QgsProcessing.TypeVector]))
self.addParameter(QgsProcessingParameterField(self.FIELD,
self.tr('Attribute to index'), None, self.INPUT))
self.addOutput(QgsProcessingOutputVectorLayer(self.OUTPUT, self.tr('Indexed layer')))
Expand Down

1 comment on commit 0383a14

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 0383a14 May 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson , isn't this useful for non spatial layers too? I've created indexes on geometryless tables to speed up joins.

Please sign in to comment.