[QGIS-Developer] Defining GeoAlgorithm processing characteristics not working like I think it should

C Hamilton adenaculture at gmail.com
Fri Jan 26 13:26:54 PST 2018


I am working on making some of my QGIS plugin capabilities into processing
algorithms. When defining input parameter characteristics for the
GeoAlgorithm I want to do something like this:

self.addParameter(ParameterVector(self.LAYER, 'Line or polygon layer',
ParameterVector.VECTOR_TYPE_LINE | ParameterVector.VECTOR_TYPE_POLYGON))

I would like it to accept both a LINE and POLYGON layers. I was guessing
that ORing the two together would work. It does not and when I try it I
don't see any of my vector layers. If I use
ParameterVector.VECTOR_TYPE_LINE or ParameterVector.VECTOR_TYPE_POLYGON
alone then I get the respective line or polygon layers listed in my input
vector selection drop down.

I would use VECTOR_TYPE_ALL, but I don't want points listed. Do I need make
two geo algorithms, one of lines and the other for polygons or am I doing
something wrong?

I am using QGIS 2.18.16 on Windows.

Thanks,

Calvin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180126/4e23456d/attachment.html>


More information about the QGIS-Developer mailing list