1

As per the documentation :

There is not a processing console in QGIS, but all processing commands are available instead from the QGIS built-in Python console. That means that you can incorporate those commands into your console work and connect processing algorithms to all the other features (including methods from the QGIS API) available from there.

My interpretation : you can use the API to link Python scripts running outside of the built in console, but it is not possible to use processing.run for v.generalize without using the QGIS built in console.

In effect would the the line from qgis import processing only be valid inside the built in console?

The goal here is to run a bunch of these generalize algorithms as part of a bigger script that I eventually want to share through a Jupiter notebook, hence my desire to get it all on one page and not have to be running some parts separately in a QGIS Python command line.

So I feel like I Should do an update here to support my recent research

: I have discovered that the use of qgis_process allows execution without running QGIS which is what I wanted. Although I suspect the availability of this plugin will be local only and won't work well in the jupyter environment (but ill cross that when I get there)

So the only issue I have been having now might warrant a separate thread : I'm able to run the v.generalize algo inside qgis with all my parameters and then use the copy gqis_process option to get the command line equivalent, however my input cannot be detected running this in command line while it works fine in QGIS, bit of a headache and I've tried a few fixes involving actual non existing input and making sure that they do exist, currently a bit stumped.

1
  • Since v.generalize is a GRASS module, why don't you make your jupyter notebook call it directly in GRASS. See, i.e. this wiki page and earlier question on StackExchange
    – Micha
    Mar 30, 2022 at 8:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.