1

I'm trying to save three layers imported from GDB (point, multipolygon, multilinestring) into one GeoPackage in QGIS 3.34.15 on MacOS.

Initially, I saved the first layer as a .gpkg file, but when I try to select this existing .gpkg file to save the second and third layer, Mac forces me to erase the existing file and create a new one with only the new layer added.

Any tips on how to solve this?

0

2 Answers 2

4

Try the "Package layers" geoalgorithm from the Processing Toolbox (Ctrl+Alt+T):

This algorithm collects a number of existing layers and packages them together into a single GeoPackage database.

0
3

You can use the GDAL tool "Convert format" from the Processing Toolbox (Ctrl+Alt+T).

When converting the first layer, set the additional parameter -nlt geometry. This will create a GeoPackage layer with geometry type GEOMETRY, which accepts mixed geometries.

convert format - first layer

When converting the additional layers, set the optional parameter -append. Further options can be found here: https://gdal.org/en/stable/programs/ogr2ogr.html.

convert format - additional layers

If you leave “Open output file after running alorithm” checked, only the features with the first geometry type added (from the first layer creation) will be shown.

But if you drag the GeoPackage file to the layers panel, there will be a popup with all the layers and geometries in the GeoPackage.

load layers into qgis

You can use DB Browser for SQLite for explore the GeoPackage contents.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.