0

Can I export a list of layers and their associated file paths (like the pop-up when you open QGIS and links are missing) for all my layers within a QGIS Project?

I want my collegue to have a mirror image of the QGIS project I have created.

Also is there a way to copy all the styles and apply them to the same project on another computer?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Mathew Bayley
  • 411
  • 2
  • 14

2 Answers2

4

Sounds like the easiest would be to send the QGIS project file and get both paths and styles. Or try qlr files, I havent: Difference between Layer Definition File (qlr) and QGIS Layer Style File (qml)?

But to export paths of all added layers you can use pyqgis to write them to a text file:

with open(r'C:\GIS\data\testdata\layerlist.txt','w') as f:
    for lyr in QgsProject.instance().mapLayers().values():
        f.write(lyr.source()+'\n')

enter image description here

BERA
  • 72,339
  • 13
  • 72
  • 161
  • If you save the .qgz file and share it, relink all the layers when opening on the new PC you get a mirror. But there are no styles. So you have to go, Properties, Symbology, Styles, Load Style, Apply etc. time and time again. Is there no simple shortcut for this? Thanks – Mathew Bayley Aug 04 '20 at 10:45
0

It is possible to export the whole project (files and styles) in a specif folder, that you can easily send to anyone, with the plugin "QPackage".

Another option could be to save the project files, styles and layers to a geopackage file, or it is possible to use a PostGIS database making it accessible from other PC.