Re: [Qgis-user] Using processing algorithms from the console in QGIS 3.0
Hi Håvard, after you have run the algorithm > processing.algorithmHelp("qgis:union") describes the > parameters of the algorithm. > Parameter names are case sensitive (at least on Ubuntu). you can also display the results in the TOC as memory layer with: param = {'INPUT': 'my_points', 'BUFFER': '0.0' ,'OUTPUT':'memory:'} processing.runAndLoadResults('qgis:voronoipolygons', param) Cheers Matteo ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Using processing algorithms from the console in QGIS 3.0
QgsApplication.processingRegistry().algorithms() does not list grass7:v.to.rast.value (but grass7:v.to.rast is there). In QGIS 3, the following seems to work: myres = processing.run("qgis:union", {'INPUT': "my_input", 'OVERLAY': "my_overlay", 'OUTPUT': "my_result"}, feedback=None)['OUTPUT'] processing.algorithmHelp("qgis:union") describes the parameters of the algorithm. Parameter names are case sensitive (at least on Ubuntu). Håvard On 21. mars 2018 17:46, Stephen Bosch wrote: Hello, I am running QGIS 3.0.0 in Linux. I'm trying to migrate some pyqgis code from 2.14 to 3.0 and discovering the hard way that just about everything has changed :) (Unfortunately, the docs haven't been updated yet and the API docs are pretty sparse.) Say I have this command, which worked in 2.x: file_grid_r = processing.runalg("grass7:v.to.rast.value", grid_v, 0, 1, extent, 0.008333, -1, 0.000100, None)['output'] processing.runalg() doesn't exist anymore, apparently it was replaced with processing.run(). However, this: file_grid_r = processing.run("grass7:v.to.rast.value", grid_v, 0, 1, extent, 0.008333, -1, 0.000100, None)['output'] does not work as expected. In the PyCharm debugger, I receive this error message: sys:1: ResourceWarning: unclosed family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 50386), raddr=('127.0.0.1', 40183)> (If the command syntax is in fact correct, then perhaps the algorithm is not accessible?) My questions: * Is there up-to-date console documentation for the Processing toolbox somewhere? * How can I get a listing of the available algorithms in the same format as in 2.x? * How do I convert the algorithm calls (processing.runalg) from 2.x to 3.x? Thanks Stephen ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user -- Håvard Tveite Faculty of Science and Technology, NMBU Drøbakveien 31, POBox 5003, N-1432 Ås, NORWAY Phone: +47 67231548 Web: http://www.nmbu.no ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Using processing algorithms from the console in QGIS 3.0
Hi Stephen, I asked a similar question at gis.stackexchange.com (https://gis.stackexchange.com/questions/274144/passing-input-output-parameters-to-processing-scripts-using-qgis-3) and I think we have to be patient. The documentation is work in progress. I am sure processing tools will work like a charm, when we will know how to use it;-) Best stefan --- Mit freundlichen Grüßen Stefan Giese Projektleiter/Consultant *** Treffen Sie uns auf der FOSSGIS Konferenz 2018 21.-24. März 2018 in Bonn https://fossgis-konferenz.de/2018/ *** WhereGroup GmbH & Co. KG Schwimmbadstr. 2 79100 Freiburg Germany Fon: +49 (0)761 / 519 102 - 61 Fax: +49 (0)761 / 519 102 - 11 stefan.gi...@wheregroup.com www.wheregroup.com Amtsgericht Bonn, HRA 6788 --- Komplementärin: WhereGroup Verwaltungs GmbH vertreten durch: Olaf Knopp, Peter Stamm --- Am 2018-03-21 17:46, schrieb Stephen Bosch: Hello, I am running QGIS 3.0.0 in Linux. I'm trying to migrate some pyqgis code from 2.14 to 3.0 and discovering the hard way that just about everything has changed :) (Unfortunately, the docs haven't been updated yet and the API docs are pretty sparse.) Say I have this command, which worked in 2.x: file_grid_r = processing.runalg("grass7:v.to.rast.value", grid_v, 0, 1, extent, 0.008333, -1, 0.000100, None)['output'] processing.runalg() doesn't exist anymore, apparently it was replaced with processing.run(). However, this: file_grid_r = processing.run("grass7:v.to.rast.value", grid_v, 0, 1, extent, 0.008333, -1, 0.000100, None)['output'] does not work as expected. In the PyCharm debugger, I receive this error message: sys:1: ResourceWarning: unclosed (If the command syntax is in fact correct, then perhaps the algorithm is not accessible?) My questions: * Is there up-to-date console documentation for the Processing toolbox somewhere? * How can I get a listing of the available algorithms in the same format as in 2.x? * How do I convert the algorithm calls (processing.runalg) from 2.x to 3.x? Thanks Stephen ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] Using processing algorithms from the console in QGIS 3.0
Hello, I am running QGIS 3.0.0 in Linux. I'm trying to migrate some pyqgis code from 2.14 to 3.0 and discovering the hard way that just about everything has changed :) (Unfortunately, the docs haven't been updated yet and the API docs are pretty sparse.) Say I have this command, which worked in 2.x: file_grid_r = processing.runalg("grass7:v.to.rast.value", grid_v, 0, 1, extent, 0.008333, -1, 0.000100, None)['output'] processing.runalg() doesn't exist anymore, apparently it was replaced with processing.run(). However, this: file_grid_r = processing.run("grass7:v.to.rast.value", grid_v, 0, 1, extent, 0.008333, -1, 0.000100, None)['output'] does not work as expected. In the PyCharm debugger, I receive this error message: sys:1: ResourceWarning: unclosed (If the command syntax is in fact correct, then perhaps the algorithm is not accessible?) My questions: - Is there up-to-date console documentation for the Processing toolbox somewhere? - How can I get a listing of the available algorithms in the same format as in 2.x? - How do I convert the algorithm calls (processing.runalg) from 2.x to 3.x? Thanks Stephen ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user