[QGIS-Developer] Using memory layer in Processing with SAGA and GRASS
matteo
matteo.ghetta at gmail.com
Mon Apr 23 02:59:08 PDT 2018
Hi devs,
sorry if I missed something on this topic, but it seems that it is not
possible using memory layer when running algorithms from the console.
A simple example should explain everything:
# QGIS
parameters = {
'INPUT' : 'big',
'OVERLAY': 'small',
'OUTPUT':'memory:'
}
result = processing.run("qgis:difference", parameters)
QgsProject.instance().addMapLayer(result['OUTPUT'])
# SAGA
parameters_saga = {
'A': 'big',
'B': 'small',
'SPLIT': True,
'RESULT': 'memory:'
}
result_saga = processing.run("saga:difference", parameters_saga)
# nothing is added with this code
QgsProject.instance().addMapLayer(result_saga['RESULT'])
with the code of above I noticed that the big difference is in:
# QGIS
result['OUTPUT']
<qgis._core.QgsVectorLayer object at 0x7f92a8a479d8
and
#SAGA
result_saga['RESULT']
'memory:'
the same happens with GRASS. The algorithms work fine if the result is
saved as file
Am I missing something for SAGA and GRASS?
Thanks for all the suggestions
Cheers
Matteo
More information about the QGIS-Developer
mailing list