14

QGIS 2.12 has support for saving a layer on the map in the GeoPackage format and that is great. However, I don't see a way to add another layer to the GPKG file, even though GeoPackage supports multiple layers. Is this functionality that is yet to come in QGIS or is there a way to do it with QGIS 2.12?

2
  • At least you do it from command line with ogr2ogr tool.
    – user30184
    Dec 25 '15 at 21:35
  • 6
    ogr2ogr -f "GPKG" out.gpkg in.[shp|gpkg] -append -update
    – jgrocha
    Jul 4 '16 at 2:57
26

I'm seeing this years later, but if someone still wonders...

In addition to the "save as" method, with QGIS 3.0, you can click and drag layers inside a GeoPackage within the Browser panel.

2
  • 1
    This worked great for me. I had to create several different layers with the same basic Attributes(fields) . I just kept dragging them in from a file and re-naming them. Thanks!
    – Cary H
    May 1 '19 at 21:53
  • 1
    thank you, this saved so much time!
    – sn1ks
    Mar 24 '20 at 13:08
6

You could use DB Manager in Menu >> Databases.

  1. Select the Database (Spatialite/Geopackage)
  2. Import layer
2
  • This method works for me using spatialite but not for geopackage. I get "error 11 connetion to database failed".
    – Colin
    Jan 10 '17 at 3:18
  • BTW I forgot to mention that I'm using QGIS 2.14.9
    – Colin
    Jan 10 '17 at 5:27
3

Right Click on the layer --> Export --> Save features as, change format to GeoPackage and choose the existing geopackage, change the layer name to what you wish and save.

1

DB Manager seems to have a bug working with geopackage data and can't be used to add another layer to a geopackage. You can use the 'save as' functionality in versions 2.18.1 and above. See: Add layer to existing geopackage not working in QGIS?.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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