6

I want to save several layer as one geopackage. That works fine. My problem is, that the layers in the geopackage have a different symbology than they had before. I found a video where you could easily keep the smybology, but in my QGIS version (3.12.3 Bucaresti) it is not possible.

Is there another way to export a layer as a geopackage file and keep the same symbology?

FreddySorbe
  • 355
  • 2
  • 9

2 Answers2

13

The symbology is not saved at the time of export, it is saved as a default symbology afterwards. To do this go to the Layer Properties of the newly created geopackage layer, set the symbology the way you want it, and at the bottom left click Style > Save as Default > Datasource Database.

Then the next time you add this geopackage layer to QGIS it will have the correct symbology.

NOTE: This won't work if you import it into Arc as symbology is treated differently by different platforms.

TeddyTedTed
  • 6,100
  • 1
  • 11
  • 36
  • Thanks for the answer. But that means that I have to redo all my symbology settings? – FreddySorbe Oct 27 '20 at 13:18
  • 1
    Try a copy/paste symbology from the layer to the other in the gpkg. Then you saved the style like TeddyTedTed said. – Leehan Oct 27 '20 at 13:55
  • What @Leehan said, I find myself copy/pasting symbology so much I made them into keyboard shortcuts (CTRL+Shift+C/V), best customisation I ever did! – TeddyTedTed Oct 28 '20 at 09:59
3

The Package Layers algorithm may be your best bet. You can find the documentation for it here: https://docs.qgis.org/3.10/en/docs/user_manual/processing_algs/qgis/database.html#package-layers

enter image description here

Note: This tool works great for vector layers, but not for rasters.

David Galt
  • 628
  • 3
  • 17