QConsolidate consolidates all project layers into single directory.
Plugin published in my repository.
Once installed and enabled, QConsolidate creates a submenu in the QGIS "Plugins" menu and also adds a button to the "Plugins" toolbar. If you don't see its icon, please make sure that the "Plugins" toolbar is enabled.
Clicking on the plugin's button or menu item will open the QConsolidate dialog.
Select the destination directory using the "Output directory" selector. You can also drag-and-drop directory from the file manager to this widget. Then, select prefferred consolidation method from the "Consolidation method" combobox and adjust additional consolidation options if necessary (see below).
If you want to export layers from the remote datasource (e.g. OGC-services, databases), check "Export layers from the remote datasources". When this option is not active, corresponding layers will be excluded from the consolidation process and will be kept in the project as is.
Some remote raster datasources, for example WMS, does not report exact raster resolution/dimensions, as result it is not possible to export layer in its original size. In such case QConsolidate will try to export raster layer using base size 2000×2000 pixels.
Make sure that your layers have unique names. Output file/table name for individual layers are generated from the layer name in the QGIS layer tree. As result multiple layers with the same names will be overwritten by the last layer with such name.
Finally, to start processing press the OK button. The dialog will close and operation will be scheduled for execution as a background task. When the task will be started by the task manager, the operation progress will be shown with a progress bar at the bottom of the QGIS main dialog. Use QGIS task manager interface to interact with the running task, e.g. interrupt it at any time.
When task cancellation requested, QConsolidate will finish consolidation of the currently processed layer and stop. However, all remaining layers will be left untouched and project will be left in the inconsistent state with some layers consolidated and other unchanged.
When task finishes, you will be informed with message bar pop-up. In the destination directory you will find QGIS project file and "layers" subdirectory, containing all layers. This project and "layers" subdirectory can be shared with others.
QConsolidate supports different consolidation methods, namely:
- Copy to directory
- Export to directory
Copy to directory
As the name suggest, this method used to consolidate project and keep original files types if possible. Underlying layer files copied to the destination directory as is. If layer can not be copied, for example this is a memory layer, it will be exported into selected format.
If layer comes from the datasource which supports sub-layers (e.g. ZIP-archive, SpatiaLite/GeoPackage, etc), a whole source file will be copied, making all other layers from this file accessible to others. If this is not desirable, please choose another consolidation method or export layer manually before running the plugin.
When using this consolidation method user can select which formats to use for raster and vector layers that can not be copied as is, using "Vector layer format" and "Raster layer format" comboboxes respectively.
If "Group files into subfolders" checkbox is checked, QConsolidate will recreate layer tree grouping, by creating additional subdirectories for each layer group in the QGIS layer tree and placing layers into corresponding subdirectories.
Export to directory
This consolidation method is very similar to "Copy to directory" method described above. The only difference is that all layers will be exported into separate files of the selected format. In other words, original file type is not preserved.
This method has same configuration options as "Copy to directory" method: you can choose which format to use for raster and vector layers, as well as group layers into subdirectories, matching QGIS layer tree grouping.
This consolidation method exports all layers (both rasters and vectors) into single GeoPackage file. It does not have any configuration options.
Because QGIS does not support relative GeoPackage raster paths, all raster layers will be stored in the project with the full paths, not relative.
This consolidation method exports all layers (both rasters and vectors) into single SpatiaLite file. It does not have any congfiguration options.
Vectors are exported as SpatiaLite layers, raster layers are not supported yet.
This consolidation method exports all layers (both rasters and vectors) as GeoPackages and creates ZIP archive from them.
Please report bugs via bugtracker.