Skip to content

Save QGIS styles in geopackage and remove them from QGIS plugin#1713

Merged
visr merged 7 commits intomainfrom
feat/gpkg-styles
Aug 13, 2024
Merged

Save QGIS styles in geopackage and remove them from QGIS plugin#1713
visr merged 7 commits intomainfrom
feat/gpkg-styles

Conversation

@evetion
Copy link
Member

@evetion evetion commented Aug 12, 2024

Fixes #610

I saved the styles to disk, and load them when writing a new geopackage. Furthermore, the styling part is removed from the QGIS plugin, which now always loads the style files (after symlinking them in the install step) as well.

@DanielTollenaar I started from the code in Ribasim-NL and hence made you co-author. However, I did change the code significantly (use parameterized sql, no regex needed on the styles, and required registration of the styles table in gpkg_contents).

@evetion evetion requested a review from visr August 12, 2024 11:22
evetion and others added 2 commits August 13, 2024 10:06
Co-authored-by: Martijn Visser <mgvisser@gmail.com>
@visr visr merged commit 352e236 into main Aug 13, 2024
@visr visr deleted the feat/gpkg-styles branch August 13, 2024 09:00
@visr visr mentioned this pull request Aug 22, 2024
visr added a commit that referenced this pull request Feb 24, 2025
This changes the style symlinking a bit from how it it was implemented
in #1713.
I ran into permission denied errors locally on
`styles_source_path.unlink` and this fixes them for me.

There are 3 places for styles:
1. ribasim python has them in the repo and uses them for adding styles
on model.write
2. ribasim_qgis expects them as a default style fallback and has them in
gitignore
3. qgis_env is such that `pixi run qgis` directly starts with the
important plugins loaded

With this PR, 3 points to 2, and 2 points to 1.

After this is merged we need to double check if ribasim_qgis.zip still
contains the styles under core/styles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write QGIS style to GeoPackage

2 participants