Feature request #17949

Allow storing multiple outputs to the same geopackage in Processing

Added by Etienne Trimaille over 6 years ago. Updated over 6 years ago.

Assignee:Victor Olaya
Pull Request or Patch supplied:No Resolution:fixed/implemented
Easy fix?:No Copied to github as #:25845


In a Processing algorithm with many output vector layers, if I set all to a geopackage file (like in my screenshot), only the last layer is written inside.

I would expect to have one geopackage, with all my layers inside.

I tried to add "layername=layer1" for instance. But Processing is raising an error about invalid output path.

Screen Shot 2018-01-24 at 17.04.14.png - The algorithm (200 KB) Etienne Trimaille, 2018-01-24 03:08 PM

Screen Shot 2018-01-24 at 17.09.51.png - The output in the geopackage (17.4 KB) Etienne Trimaille, 2018-01-24 03:09 PM

multioutput.png (35.7 KB) Nyall Dawson, 2018-01-25 01:49 AM

Associated revisions

Revision bf19eb6f
Added by Nyall Dawson over 6 years ago

[processing] Non-filed based outputs (e.g. postgis, geopackage)
options should be available for certain model outputs and script
algorithm outputs

We do this by swapping the test for non-file based output support
from checking only the algorithm's provider to instead checking
on a parameter-by-parameter basis.

This is done in order to support models. For models, depending
on what child algorithm a model output is based off, an individual
model may or may not have support for non-file based outputs. E.g
a model may generate outputs from a native qgis alg (supporting
these outputs) AND an output from a GDAL alg (with no support
for these outputs). In this case we need to enable or disable
the ui controls for non-file based outputs on an individual
output basis.

For scripts (for now) we blindly just say all outputs support
non-file based formats. This is going to be the case most of
the time, since scripts will usually be written using PyQGIS
API. For the exceptions (e.g. scripts which call other algs
like GDAL algs) we probably should add some way for the script
to indicate whether an individual output supports this, but
for now we just say they all do.

Fixes #17949


#1 Updated by Nyall Dawson over 6 years ago

  • Subject changed from Only the last layer is saved if we output to the same geopackage in Processing to Allow storing multiple outputs to the same geopackage in Processing
  • Tracker changed from Bug report to Feature request

#2 Updated by Nyall Dawson over 6 years ago

Note that this is already supported for native algorithms, by choosing the "Save to Geopackage" option, where you get prompted for a layer name. See attached screenshot.

We'd have to expose this to compatible models and scripts too.

#3 Updated by Nyall Dawson over 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#4 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF