Qgis-processing advises that output layers are specified with syntax such as

##foo=output vector

The manual advises against manually loading output layers (in your script code) as QGIS will do this automatically based on the above code.

What if the number of output layers is not known until runtime? Is there a way to do this besides loading them manually and specifying ##nomodeler?

  • Not sure I follow you 100%, are you wanting to load all output files automatically regardless of how many there are? If so then you can use the runandload function. E.g. processing.runandload("qgis:myAlgorithm",...). – Joseph Sep 25 '15 at 9:25
  • Yes, that's what I want. Though if I use the call you suggest, how will processing know where those files are? the syntax I quote in the question only allows me to tell QGIS where a fixed number of named outputs will reside. – Sideshow Bob Sep 25 '15 at 10:54
  • Not much of an expert on this so can't comment much :). But once a process is complete, the file will be saved either in the location you set or in the temp folder. Regardless where, QGIS can still load the output. If you edit your question to include your script, I'm sure you will get the attention of potential answerers :) – Joseph Sep 25 '15 at 11:01
  • There isn't a script yet. But maybe a link to the docs I'm talking about will help add context to the discussion? docs.qgis.org/2.6/en/docs/user_manual/processing/… – Sideshow Bob Sep 25 '15 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.