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

Jean-Charles Quillet jeancharles.quillet at gmail.com
Wed Mar 11 00:45:44 PDT 2020


Hi Nyall,

Thanks for your answer.

If it doesn't take too much time for you, yes please, you can send me these
hints on how to implement this. I'll add it in my backlog and I'll be happy
to do it if I find the time (and manage to sell it to my boss, but he might
be ok as it's an issue for us).

Jean-Charles


Le mer. 11 mars 2020 à 00:01, Nyall Dawson <nyall.dawson at gmail.com> a
écrit :

> On Wed, 11 Mar 2020 at 02:27, Jean-Charles Quillet
> <jeancharles.quillet at gmail.com> wrote:
> >
> > 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 ?
>
> Unfortunately - an API call to to this automatically just doesn't
> exist in current QGIS versions. If you're keen to dig into QGIS core
> development I can give some pointers on how this should be added...
>
> Nyall
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200311/d67d38a7/attachment.html>


More information about the QGIS-Developer mailing list