4

I'm trying to use a GeoPackage to store a collection of styles - the idea is that each map sheet (it's a geological map) comes as a series of shapefiles, and of course each shapefile require its own style. Let's call them mapsheet001_pgon.shp, mapsheet001_pline.shp, mapsheet002_pgon.shp and so on. The style is in addition defined using SVG symbols.

I would like to distribute all the styling as one single file, independent from the shp. In this way, the users can download the map sheet they need (itself made of several shapefiles), but nothing more; the styles GeoPackage; and style the specific map sheet needed. I want to use GeoPackage if only because of the possibility to store the SVG in it, so the user does not need to set an SVG path to locate the symbols. I do not wish to convert every single map sheet to a GeoPackage, too many of them so it would be both time and space consuming.

I managed to load the SVG symbols in the database (Read (and write) SVG from Geopackage with QGIS) and apply the styles to a layer.

I can save the style to a QML.

I can save the style into the GeoPackage if and only if I first import a layer in the DB, so now I have a DB including the SVG symbols, the styling info and one layer (let's say mapsheet001_pgon). I save the GeoPackage as map_styling.gpkg; it has tables SVG (no geometry), mapsheet001_pgon and layer_styles (no geom, but column styleQML storing the info I need).

If I now load a second layer, as a shapefile (mapsheet002_pgon.shp), how can I retrieve the style from the GeoPackage? Of course, I can open the GeoPackage layer (mapsheet001_pgon@map_styling.gpkg), copy the style, paste it to the shp layer but this is somewhat contrived. In addition, my styling DB includes a "dummy" map sheet that is not really required.

What I'd like is a geoDB including only SVG and layer_styles, with the possibility to apply styles from layer_styles to any loaded layer in my project.

QGIS 3.16 (QGIS 3.22 on my own computer but user base likely to use the 3.16 LTS)

Taras
  • 32,823
  • 4
  • 66
  • 137
jfmoyen
  • 454
  • 3
  • 9

0 Answers0