0

I got a qgis project with different layers and each layer has a different svg-symbol. Now I need the same symbols for another qgis project with slightly different layers. Is there an option to copy all the symbols at once and paste it to the other project layers? I just know the method to create styling files for all the layers seperated which is time consuming.

2 Answers 2

2

You can try to set relative paths in the project and replace the data with new ones automatically (file names must be the same for this). enter image description here

Example. Original folder:

C:\folder_1\project_file.qgz (original project file)

C:\folder_1\vector_data_1.gpkg

New folder:

C:\folder_2\project_file.qgz (original project file)

C:\folder_2\vector_data_1.gpkg (other data file with the same name)

2
  • Can you explain this in more detail? Whats next after setting relative path names? How to replace the data with new ones automatically? Jan 24, 2023 at 7:53
  • 1
    @Barrylim_work See update. Jan 24, 2023 at 9:12
0

You could write two functions with pyqgis.

  1. Iterate over all Layers: For each layer save Style as YOUR/DESIRED/FOLDER/layername.qml

  2. Iterate over all Layers: For each layer load Style from YOUR/DESIRED/FOLDER/layername.qml

You need to write it just once. Then you can use it whenever you want. Then its just time consuming for the first time!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.