Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
podcast
Filter by Categories
ArcGIS Pro
GDAL
GeoJson
Map
Map Tools
Maps
postgis
Python
QGIS
Uncategorized

Converting Shapefiles to a GeoPackage in QGIS

Converting Shapefiles to a GeoPackage in QGIS

In this tutorial, we will walk through the process of converting multiple shapefiles into a GeoPackage in QGIS. This method not only simplifies project sharing but also enhances data management efficiency.

If you want to save every layer in your QGIS project into a GeoPackage check out the “Project Packager” plugin!

Step 1: Preparing Your Project

First, create a parent folder on your desktop. Inside this folder, organize your shapefiles and the QGIS project file. A typical structure might look like this:

  • Parent Folder
    • Shapefiles
    • QGIS Project.qgz

Ensure that your shapefiles are correctly placed in the designated folder.

Step 2: Opening Your Project

Open your QGIS project. You should see the shapefiles loaded in the Layers panel. Before proceeding, make sure all layers are visible and functioning correctly.

QGIS project with shapefiles loaded

Step 3: Exporting Shapefiles to a GeoPackage

To convert your shapefiles to a GeoPackage, right-click on each layer in the Layers panel and select Export > Save Features As…. Choose GeoPackage as the format.

Exporting shapefiles to GeoPackage

Step 4: Naming Your GeoPackage

When prompted, navigate to your parent folder and name the GeoPackage appropriately (e.g., projectname.gpkg). Ensure that the coordinate reference system (CRS) is set correctly.

Naming the GeoPackage

Step 5: Adding Layers to the GeoPackage

Continue exporting each shapefile layer to the same GeoPackage. Make sure to uncheck the option that adds the exported layer to the current project to avoid duplicates.

Exporting multiple layers to the same GeoPackage

Step 6: Connecting to Your GeoPackage

In the Browser panel, right-click on GeoPackage and select New Connection. Navigate to your created GeoPackage and open it. You should see all the layers listed inside.

Connecting to the GeoPackage

Step 7: Changing Data Sources

Now that your layers are exported, you need to change their data source to reference the GeoPackage instead of the original shapefiles. Right-click on each layer, select Properties, then Change Data Source, and navigate to the respective layer in the GeoPackage.

Changing data sources for layers

Step 8: Saving the Project in the GeoPackage

To save the entire project within the GeoPackage, go to Project > Save to > GeoPackage. Select your GeoPackage connection and give the project a name.

Saving the project into the GeoPackage

Step 9: Exporting Raster Data

If you have raster data (e.g., background images), export it similarly. Right-click on the raster layer, select Export > Save As…, and choose the GeoPackage format. Name it (e.g., Google Image) and set the CRS.

Exporting raster data to the GeoPackage

Step 10: Moving and Sharing the GeoPackage

Once everything is saved in the GeoPackage, you can move it to another location. Open QGIS again, create a new connection to the moved GeoPackage, and load your project seamlessly.

FAQ

  1. What is a GeoPackage?

    A GeoPackage is an open format for geographic information systems that can store various types of data, including vector features and raster images, in a single file.

  2. Why use a GeoPackage instead of shapefiles?

    GeoPackages are more efficient and elegant for data management, allowing multiple layers and types of data to be stored in one file.

  3. Can I share a GeoPackage easily?

    Yes, a GeoPackage can be easily shared as a single file, making collaboration and data transfer much simpler.

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.