Sunday, 29 September 2019

Iterating clip over multiple layers using QGIS?


I have multiple vector layers and a fishnet grid. I would like to clip all the layers based on all features in this fishnet grid.


I can use the iterate over layer function in the clip tool, but cannot select multiple layers. I would like this to be automatic.


So my goal is to get multiple input layers, but keep the iterate clip layer the same.


iterate


I have tried applying the knowledge in Iterating over map layers in QGIS python?, but cannot seem to understand or get it to work to iterate using the Clip tool.




Answer



You can use the Graphical Modeller (Processing menu) to build the desired process. Add as many layers as you like, add your grid, then switch tabs and add a clip-process for each vector-layer and set the output as final. Though it is a bit more work than simply running a batch process, it saves time if you want to/have to repeat the process.


For illustration purposes: enter image description here Purple are layers, white are processes, teal is a final output. One layer may be used for several processes, saving you some time compared to running a batch.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...