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?
Asked
Active
Viewed 2.1k times
17
4 Answers
30
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.
b_jugger
- 103
- 12
Nat Azodnem
- 451
- 4
- 8
-
1This 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 01 '19 at 21:53
-
1
-
I discovered that (QGIS 3.10) you can create a new GeoPackage layer and specify the GeoPackage file you aleady have, and QGIS will warn you whether you want to "Overwrite" or "Add Layer" to existing file. – Tom Charles Zhang Oct 24 '23 at 11:33
8
You could use DB Manager in Menu >> Databases.
- Select the Database (Spatialite/Geopackage)
- Import layer
Carlos López Quintanilla
- 1,519
- 10
- 15
-
This method works for me using spatialite but not for geopackage. I get "error 11 connetion to database failed". – Colin Jan 10 '17 at 03:18
-
7
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.
Enock4seth
- 127
- 1
- 6
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?.
ogr2ogr -f "GPKG" out.gpkg in.[shp|gpkg] -append -update– jgrocha Jul 04 '16 at 02:57