Is there a way to apply field calculator for multiple layers at once?
For instance, I have 80 layers as the picture shown below. If I want to apply $area for all the layers, is there a quicker way to do it except manually creating 'area' field?
this is how it looks after applying recommendation using pyqgis
Answer
Other solution but it will make a new layer with the result and will not modify your current layers.
The steps : First use merge vector layers and select all the layers. This will merge all your vector layer in one new layer and add two fields "layer" with the source layer name and "path" with the source layer path. Then you can make your new field "area" to store $area.
Then if you want back your 80 layers you can use split vector layers based on "layer" field.
No comments:
Post a Comment