2

I've created a geopackage in QGIS (3.22.1), by setting up groups and subgroups in my Layers pane, and then simply going to File -> Save To -> GeoPackage. Now if the source files are moved from their original locations, the geopackage upon opening will throw errors for missing data for each given layer where the source file has been moved.

Is there a way to embed the source files INTO the geopackage to make it a stand alone single file that can be opened independently by another user, without having to include all the source files along with the geopackage?

4
  • I'm not 100% sure what you mean, but is certainly possible to save layer styles and even the QGIS project within a GeoPackage which makes it very portable.
    – Matt
    Commented Nov 10, 2023 at 18:55
  • If I were to create the geopackage, it looks like it holds a reference to the original file, not the file itself. So if I were to delete the original source files from their location on lets say windows desktop, if I reopen the geopackage, the reference searching for those layers can't be found. Is this not the expected behavior of the geopackage?
    – Kevin K
    Commented Nov 10, 2023 at 19:09
  • I see what you mean now. Using File > Save To > GeoPackage saves your QGIS project to a GeoPackage, but indeed, it does not save your data sources to that GeoPackage. What you can do is use the Package Layers tool first, and then save your project to the GeoPackage that is created as the output.
    – Matt
    Commented Nov 10, 2023 at 19:24
  • good deal, if you want to formally post as an answer I'll gladly accept. This seems to solve the issue
    – Kevin K
    Commented Nov 10, 2023 at 19:26

1 Answer 1

5

To encapsulate your whole project into a single GeoPackage file:

  1. Use the Package Layers tool which will copy all your various data sources into a single GeoPackage file
  2. Now use File > Save To > GeoPackage as you did before with the output of step one as the target.

This GeoPackage can be given to another user as a standalone file.

To open the project, use File > Open From > GeoPackage.

Whilst you can also explicitly save layer styles into the GeoPackage, simply saving the QGIS project will maintain the layer styles when it is opened again (using QGIS).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.