Skip to content

Commit

Permalink
[processing] Select by expression/attribute can run on geometryless l…
Browse files Browse the repository at this point in the history
…ayers
  • Loading branch information
nyalldawson committed Feb 19, 2018
1 parent da7ccf7 commit c07f37a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/qgis/SelectByAttribute.py
Expand Up @@ -27,6 +27,7 @@

from qgis.PyQt.QtCore import QVariant
from qgis.core import (QgsExpression,
QgsProcessing,
QgsProcessingException,
QgsProcessingAlgorithm,
QgsProcessingParameterVectorLayer,
Expand Down Expand Up @@ -89,7 +90,7 @@ def initAlgorithm(self, config=None):
self.tr('does not contain')
]

self.addParameter(QgsProcessingParameterVectorLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterVectorLayer(self.INPUT, self.tr('Input layer'), types=[QgsProcessing.TypeVector]))

self.addParameter(QgsProcessingParameterField(self.FIELD,
self.tr('Selection attribute'), parentLayerParameterName=self.INPUT))
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/qgis/SelectByExpression.py
Expand Up @@ -25,6 +25,7 @@
__revision__ = '$Format:%H$'

from qgis.core import (QgsExpression,
QgsProcessing,
QgsVectorLayer,
QgsProcessingAlgorithm,
QgsProcessingException,
Expand Down Expand Up @@ -60,7 +61,7 @@ def initAlgorithm(self, config=None):
self.tr('removing from current selection'),
self.tr('selecting within current selection')]

self.addParameter(QgsProcessingParameterVectorLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterVectorLayer(self.INPUT, self.tr('Input layer'), types=[QgsProcessing.TypeVector]))

self.addParameter(QgsProcessingParameterExpression(self.EXPRESSION,
self.tr('Expression'), parentLayerParameterName=self.INPUT))
Expand Down

0 comments on commit c07f37a

Please sign in to comment.