[QGIS-Developer] QGIS 3.0 Processing plugin - handling multiple outputs

Luke lukepinnerau at gmail.com
Thu Feb 1 17:03:34 PST 2018


I'm updating my QGIS processing plugin algorithm from 2x - 3x.  The algorithm
generates and outputs one to many rasters. The number of output rasters is
unknown until the algorithm is run and depends on the input parameters.

In my QGIS 2x version, I just set a processing.core.outputs.OutputDirectory,
dumped all the rasters in there and then added them to the map using the
QgsMapLayerRegistry.instance().addMapLayer method.  A bit dodgy, but the 2x
version was just a quick proof of concept.

Is there a recommended approach for QGIS 3x in the processing framework to
handle an unknown number of outputs?  Or should I just  do something similar
to my 2x version, set a
QgsProcessingParameterFolderDestination/QgsProcessingOutputFolder and add
them to the map via QgsProject.instance().addMapLayer?


Regards
Luke



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html


More information about the QGIS-Developer mailing list