-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add settings for controlling margin around labels, and preventing duplicate labels #61475
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
base: master
Are you sure you want to change the base?
Conversation
As well as avoiding multiple re-calculation of this, caching ensures that we ALWAYS return the same bounds, which is crucial when we need to remove the position from a spatial index
into candidate spatial indexes We need to use the expanded bounds for candidate conflicts, not the actual label bounds. Otherwise rules like minimum distance between labels won't work, as potential conflicts aren't getting returned when searching the candidate spatial indexes.
Allows setting a margin around a layer's labels, which prevents other labels from being placed closer than this margin distance to the layer's labels.
Improves the appearance of labels in situations like road networks, where things like dual carriageways, service roads, etc can result in many labels of the exact same text appearing close to each other. When active, removes any labels with the exact same text (case sensitive!) which are closer then this minimum distance. The setting applies across layers, so duplicate text from ANY layer will be considered.
@nyalldawson A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged. Please update the description (not the comments) with helpful description and screenshot to help the work from documentors. Thank you! |
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
It should fix #44538 too |
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
Replace the widgets with a label stating "not available on this QGIS installation"
I think before closing that we should have some mechanism in place to automatically set margins in the background based on the callout shape settings. I don't think users should have to manually set this. |
This PR adds two new settings for vector layer labels:
Note that both settings require a build based on GEOS 3.10 or later.
TODO:
Fixes #23154