3 ways of exporting multiple layers in QGIS
Exporting multiple layers at once in QGIS can significantly streamline your workflow, especially when working with large projects. While QGIS does not provide a single dedicated button to export every layer simultaneously through the standard GUI, it offers several effective approaches: a third-party plugin, the built-in Processing Toolbox batch processing interface, and Python scripting. The methods below focus primarily on vector layers.
Working with QGIS? You should be listening to our podcast!
Method 1: Using the “Batch Save Layers” Plugin
One of the easiest ways to export multiple layers at once is by using the “Batch Save Layers” plugin. This plugin lets you export multiple vector layers to different file formats in a single operation.
- Install the plugin:
- Go to
Plugins>Manage and Install Plugins... - Search for “Batch Save Layers” and install it.
- Use the plugin:
- After installation, access the plugin under
Plugins>Batch Save Layers>Batch Save Layers. - In the plugin window, add the layers you want to export, specify the output format, and configure options such as CRS, file name, and output directory.
- Export:
- Configure all settings according to your needs.
- Click
Runto export all selected layers.
Method 2: Using the Processing Toolbox for Batch Export
For vector layers, you can use the built-in Processing Toolbox to run a batch export without any additional plugins.
- Open the Processing Toolbox:
- Click the toolbox icon in the toolbar, or go to
Processing>Toolbox.
- Find the export tool:
- Search for “Save Vector Features to File” (algorithm ID:
native:savefeatures). This is the standard QGIS tool for exporting vector layers to a file format of your choice.
- Run as a batch process:
- Right-click the tool and select
Execute as Batch Process. - In the batch processing window, click
Add Rowfor each layer and configure the output format, destination path, and any other parameters.
- Configure and run:
- Set the output path and any other necessary parameters for each row.
- Click
Runto start the batch export.
Tip: If you want to package all layers into a single file, use the “Package Layers” tool in the Processing Toolbox (Database group). It exports multiple vector layers into one GeoPackage in a single step.
Method 3: Using Python Scripting
For advanced users, Python scripting within QGIS allows for a highly customisable export process. You can write a script to iterate through your layers and export each one with your chosen parameters.
- Open the Python Console in QGIS:
- Go to
Plugins>Python Console(or pressCtrl+Alt+P).
- Write a script:
- Use
QgsProject.instance().mapLayers()to retrieve all loaded layers, then loop through them and callprocessing.run("native:savefeatures", {...})for each vector layer. This is the recommended modern approach in QGIS 3.x, as the olderQgsVectorFileWriter.writeAsVectorFormat()function has been deprecated in favour ofQgsVectorFileWriter.writeAsVectorFormatV3()and the Processing framework.
- Execute the script:
- Run your script in the Python Console to export the layers.
Each of these methods provides a way to export multiple layers at once in QGIS, with varying degrees of flexibility and complexity. Choose the one that best fits your needs and skill level.
Frequently asked questions
Can I export both raster and vector layers at the same time in QGIS?
QGIS does not offer a single built-in command that exports both raster and vector layers simultaneously through the GUI. The export workflows for raster and vector data are distinct because of the different nature of the data types and the format options available for each. However, there are effective workarounds that allow you to handle both efficiently.
Workarounds and methods
- Batch processing with Python scripting: The most flexible approach is to write a PyQGIS script that iterates through all loaded layers, checks whether each is raster or vector, and exports it using the appropriate method. This gives you full control over output formats, file naming, and CRS handling.
- Using plugins: Plugins such as “Batch Save Layers” are designed for vector layers and streamline a large part of the process. For raster layers, separate tools or scripting are still required.
- Sequential batch processing: You can process vector and raster layers separately but efficiently, one after the other. For vector layers, use “Save Vector Features to File” in batch mode via the Processing Toolbox. For raster layers, use “Translate (Convert Format)” in the same batch mode. While this does not export everything in a single step, it can be configured to run each batch in sequence.
- Automation outside QGIS: External scripts using Python with GDAL/OGR can handle the export of both raster and vector data independently of QGIS. This approach requires a good understanding of GIS data formats and scripting, but it integrates well into larger data processing pipelines.
Maintaining layer styles when exporting
When exporting vector layers from QGIS, you may want to preserve the styling — colours, symbols, line widths, and so on — that you have applied within the project. Whether styles are retained depends on the export format and the method used.
- Exporting to GeoPackage or Shapefile: For vector layers, styles can be saved within a GeoPackage or alongside a Shapefile as a
.qmlfile.- To save a style into a GeoPackage, right-click the layer >
Export>Save Features As..., chooseGeoPackageas the format, and check the option to save the layer style into the database. - To save a Shapefile’s style separately, right-click the layer >
Properties>Symbology, then useSave Style...and chooseQGIS Layer Style File (*.qml).
- To save a style into a GeoPackage, right-click the layer >
- Exporting to PDF or SVG: If you need to export a map with its styles intact for presentation or publication, use the
Print Layoutfeature to design your map and then export it as a PDF or SVG. The rendered styles are preserved exactly as they appear in the layout.
Batch exporting layers with different CRS settings
When exporting multiple layers that use different coordinate reference systems (CRS), QGIS gives you control over the CRS of each output file. Here is a general approach using batch processing.
- Prepare your layers: Ensure that each layer has its correct source CRS assigned in the layer properties. QGIS reprojects layers on the fly for display purposes, but the source CRS is what matters when exporting.
- Batch export using the Processing Toolbox:
- Search for “Save Vector Features to File” in the Processing Toolbox, right-click it, and choose
Execute as Batch Process. - In the batch dialog, add a row for each layer. For each row, specify the output format, destination path, and — importantly — the output CRS. You can choose to use each layer’s source CRS, the project CRS, or any other CRS you require.
- Search for “Save Vector Features to File” in the Processing Toolbox, right-click it, and choose
- Using Python for advanced control: A PyQGIS script gives you full programmatic control over CRS handling. You can check each layer’s source CRS, apply any necessary transformations, and export each layer with its original CRS or a standardised target CRS.
- CRS considerations: When exporting layers for use in other projects or software, maintaining a consistent CRS across all output files ensures spatial accuracy and compatibility. If the outputs will be combined in a single project or analysis, consider standardising all layers to a common CRS before exporting.




