-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configurable extent buffer to symbol layers #59630
base: master
Are you sure you want to change the base?
Add configurable extent buffer to symbol layers #59630
Conversation
- Also add a function to find the maximum extent buffer from the symbol's layers
…rendering_out_of_extent
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
Tests failed for Qt 6One or more tests failed using the build from commit 371ee87 buffer_extent_zerobuffer_extent_zeroTest failed at testRenderWithExtentBuffer at tests/src/python/test_qgsvectorlayerrenderer.py:848 Rendered image did not match tests/testdata/control_images/vectorlayerrenderer/expected_buffer_extent_zero/expected_buffer_extent_zero.png (found 54 pixels different) The full test report (included comparison of rendered vs expected images) can be found here. Further documentation on the QGIS test infrastructure can be found in the Developer's Guide. |
@JuhoErvasti thanks for tackling this annoying problem! I have a few thoughts on the approach used here:
|
I agree that making it a symbol layer property does complicate things and the use cases for separate buffer levels are probably few and far between. The reason I did it this way was based on your comment from the issue's discussion:
I interpreted this to mean that it does need to be a symbol layer property, but reading the thread again you might've meant it as a symbol property (as opposed to layer/project property as suggested by others)? Either way if that isn't the requirement, I'm happy to change it to be on the symbol level.
Sounds good.
I figured it'd be good to be able to control the buffer with an expression (for example to make it scale-dependant as you mentioned) and since I was adding it as a symbol layer property it made sense to use a data-defined button since almost everything else has one. But if the location of the property is changed, this can of course be changed too. Could it be even just a normal expression widget, not a data-defined override button?
If it's done on the symbol level, how should this work? If you're using f.e. the graduated renderer you could set a different expression/value for each symbol, same with the geometry generator subsymbols. Wouldn't it have to be evaluated at least once per each symbol in the renderer? |
Fixes #38579.
Allows the user to set an extent buffer per symbol layer. Useful with for example geometry generator symbols:
2024-11-28.13-21-52.mp4
Works with a negative buffer as well:
2024-11-28.13-25-10.mp4
Works with labels which are placed by the geometry generator:
2024-11-28.13-31-49.mp4
When rendering
QgsVectorLayerRenderer
finds the biggest buffer value that has been set and requests features from the buffered extent. Further filtering per symbol layer is done inQgsSymbol
.Backport to 3.40 requested (if possible).
Funded by the National Land Survey of Finland.