Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
post

Exporting multiple layers from QGIS

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.

  1. Install the plugin:
  • Go to Plugins > Manage and Install Plugins...
  • Search for “Batch Save Layers” and install it.
  1. 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.
  1. Export:
  • Configure all settings according to your needs.
  • Click Run to 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.

  1. Open the Processing Toolbox:
  • Click the toolbox icon in the toolbar, or go to Processing > Toolbox.
  1. 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.
  1. Run as a batch process:
  • Right-click the tool and select Execute as Batch Process.
  • In the batch processing window, click Add Row for each layer and configure the output format, destination path, and any other parameters.
  1. Configure and run:
  • Set the output path and any other necessary parameters for each row.
  • Click Run to 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.

  1. Open the Python Console in QGIS:
  • Go to Plugins > Python Console (or press Ctrl+Alt+P).
  1. Write a script:
  • Use QgsProject.instance().mapLayers() to retrieve all loaded layers, then loop through them and call processing.run("native:savefeatures", {...}) for each vector layer. This is the recommended modern approach in QGIS 3.x, as the older QgsVectorFileWriter.writeAsVectorFormat() function has been deprecated in favour of QgsVectorFileWriter.writeAsVectorFormatV3() and the Processing framework.
  1. 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.

  1. Exporting to GeoPackage or Shapefile: For vector layers, styles can be saved within a GeoPackage or alongside a Shapefile as a .qml file.
    • To save a style into a GeoPackage, right-click the layer > Export > Save Features As..., choose GeoPackage as 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 use Save Style... and choose QGIS Layer Style File (*.qml).
  2. Exporting to PDF or SVG: If you need to export a map with its styles intact for presentation or publication, use the Print Layout feature 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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
About the Author
I'm Daniel O'Donohue, the voice and creator behind The MapScaping Podcast ( A podcast for the geospatial community ). With a professional background as a geospatial specialist, I've spent years harnessing the power of spatial to unravel the complexities of our world, one layer at a time.