To insert this function to my program I want to know what is command line executed by the algorithm "Merge vector layers" using QGIS GUI.
Answer
After you run an algorithm from the Processing Toolbox, you can go to Processing -> History... -> ALGORITHM
and you'll find the Python command to call the algorithm with the parameters you specified via GUI. For instance:
processing.runalg("qgis:mergevectorlayers",
"/docs/geodata/AMAZONAS.shp;/docs/geodata/PUTUMAYO.shp",
"/docs/merged.shp")
You would need to import the processing
module before running the algorithm from the QGIS Python Console:
import processing
processing.runalg("qgis:mergevectorlayers",
"/docs/geodata/AMAZONAS.shp;/docs/geodata/PUTUMAYO.shp",
"/docs/merged.shp")
It's very helpful to understand the parameters of the algoritm, which you can achieve by following @DIVAD's recommendation.
No comments:
Post a Comment