[QGIS-Developer] How to convert multiple "in memory" layers parameters to an actual list of files ?

Jean-Charles Quillet jeancharles.quillet at gmail.com
Tue Mar 10 09:26:58 PDT 2020


Hello,

I'm working on a processing plugin. My input parameters are:

   - one point layer
   - a non empty list of line layers

I've found that some of the layers are stored in memory and are not actual
files. It happens when a layer is created by QGIS plugins. But for my
algorithm I need actual files because the work is done by an external
process.

I've been reading through the GDAL and Grass plugins which have the same
architecture as mine (launch an external process to do the work). And the
function parameterAsCompatibleSourceLayerPath is called to convert an in
memory layer to an actual file. I've used successfully this behavior for
the point layer and it's working perfectly fine.

However, I cannot find any example of doing the same on a
QgsProcessingParameterMultipleLayers, the parameters for my line layers.
And the function parameterAsCompatibleSourceLayerPath takes the name of the
parameter and returns only one string, so it doesn't seem to work
on QgsProcessingParameterMultipleLayers.

What would be the right way to convert a potentially "in
memory" QgsProcessingParameterMultipleLayers to an actual list of files ?

Thanks for your help,

Jean-Charles

PS: I'm using QGIS 3.10.2-A Coruña on windows 10 64 bits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200310/fcabfa8b/attachment.html>


More information about the QGIS-Developer mailing list