Save QGIS styles in geopackage and remove them from QGIS plugin#1713
Merged
Save QGIS styles in geopackage and remove them from QGIS plugin#1713
Conversation
Co-authored-by: Daniel <daniel@d2hydro.nl>
visr
reviewed
Aug 12, 2024
Co-authored-by: Martijn Visser <mgvisser@gmail.com>
visr
approved these changes
Aug 13, 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).