Saving a QGIS Project to a GeoPackage: A Step-by-Step Guide

Step 1: Open the Package Layers Tool

To begin, open the Package Layers tool from the Processing Toolbox. This tool allows you to package vector layers into a new GeoPackage.

Opening the Package Layers tool in QGIS

Step 2: Select Layers to Package

Choose the layers you want to package. For this example, select the catchment boundary and channels. Ensure the option to save the styles into the GeoPackage is checked by default.

Selecting layers to package

Step 3: Name Your GeoPackage

Next, choose an output name for your GeoPackage file and click Run. This will create your GeoPackage with the selected layers.

Naming the GeoPackage

Step 4: Refresh the Browser Panel

After running the tool, refresh the Browser Panel. You should see your new GeoPackage containing the two layers.

Refreshing the Browser Panel to see new GeoPackage

Step 5: Add More Layers

If you want to add more layers, such as the DEM subset TIFF layer, simply drag the layer into the GeoPackage. Note that styles for raster layers will not be imported.

Adding DEM subset TIFF layer to GeoPackage

Step 6: Add Layers to the Project

After importing, the layers need to be added to the project manually. Select the layers and drag them to the map canvas.

Dragging layers to the map canvas

Step 7: Clean Up Non-GeoPackage Layers

Remove any non-GeoPackage layers from your project, keeping only the layers you want from the GeoPackage. Rename layers to avoid confusion.

Step 8: Duplicate and Style Layers

Duplicate the DEM layer and name the duplicate hillshade. Because raster styles are not stored in a GeoPackage, copy the style from the original GeoTIFF layer and paste it onto the new layer using right-click > Styles > Copy Style and Paste Style.

Duplicating layers and applying styles

Step 9: Finalize Your GeoPackage

Once you have styled your layers, remove any unnecessary ones. You can verify which layers belong to your GeoPackage by hovering over them in the Layers panel. Finally, save the project to the GeoPackage using Project > Save To > GeoPackage to consolidate everything into one file.

Saving the project to the GeoPackage

Step 10: Complete the Process

After saving, your project is now stored in one GeoPackage file. This includes all vector layers, their styles, and the project settings. Note that raster data is stored in the GeoPackage but raster styles are not — you will need to re-apply raster styles if you open the project on another machine.

FAQ

What is a GeoPackage?

A GeoPackage is an open, standards-based format for storing geospatial data. Based on SQLite, it can store vector data, raster data, and associated vector styles in a single portable file. The format is defined by the Open Geospatial Consortium (OGC) standard.

Can I store raster styles in a GeoPackage?

No. QGIS can store vector layer styles inside a GeoPackage, but raster layer styles cannot be saved to a GeoPackage. If you add a raster layer to a GeoPackage project, you will need to re-apply the raster styling manually after opening the project.

How do I open a GeoPackage in QGIS?

You can open a GeoPackage by navigating to the Browser Panel, locating your GeoPackage file, and dragging the layers into your map canvas.

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.