Feature request #3843
Rule based labeling
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
I think it would be a cool idea to have rule based labeling, something like we already have for the styling.
I had a case today that it would be good to label the main trunk lines (anything diameter > 350mm) of a stormwater network in red and bold and anything less in light gray so it's less distracting but it's still visible.
The lines were already styled using the rules to show a different scale but having rules on the labels would be very handy.
#1 Updated by Andrew Chapman almost 6 years ago
I also regularly miss this feature. In the UK, the Ordnance Survey text layers have attributes that could potentially be used - currently one can only use them to select & save sub-sets of a layer then style as a new layer. One text layer can easily expand to 20... and with possibly 20 tiles, layer count and management starts to get out of hand.
#2 Updated by Giovanni Manghi over 5 years ago
- Assignee deleted (
- Priority changed from Low to High
- Target version deleted (
- Must fix deleted (
- Operating System deleted (
- Pull Request or Patch supplied set to No
I agree that this is a important missing feature... now we have the rule based renderer is not hard to imagine how powerful the combo would be.
See also #3796
#3 Updated by Sandro Santilli over 5 years ago
The cherry-on-cake would then be associating "rules" to "legend items" so that you can toggle visibility of single classes (both for features and labels).
Having that would completely replace my current hack described in issue #3796 for having multiple, optionally visible, labels per layer.
#13 Updated by Schalk Grobbelaar about 2 years ago
Gavin Fleming wrote:
another use case: labelling property boundaries with bearing above the line and distance below the line. At the moment the layer has to be brought in twice to do this.
Agree Gavin. This issue was opened 4 years ago and up to today it is still missing. I use this a lot and that is the thing that I talked about in that meeting with you and Tim where QGIS is lacking a lot of powerful SLD functions. In my use case: I, for example have different Rules based on different scales. Lets say I have a Layer (Provinces) that contains 2 fields (abbr and prov_name). I start of by showing the abbreviation field (abbr) as the label (Rule 1) and as the user zooms in he/she sees the prov_name (Rule 2) on another scale. This cannot be done in QGIS, only in Geoserver by editing the XML by hand (which takes a lot of time). The only thing missing here is to have an interface where you can also set label settings per rule which creates the <se:TextSymbolizer> under <se:Rule>.
I will really appreciate it if someone can come up with a solution for this.
#15 Updated by Andreas Neumann almost 2 years ago
I agree with Paolo.
Someone who really needs this should step up and sponsor this feature or it won't be solved for another five years.
Introducing labeling rules is not a small feature that can be implemented in one evening. It requires several days of work. If no one pays for it or implements it by himself, it won't happen.
The majority of the recent new features in the past releases were paid development.
You can expect smaller issues to be solved by someone in his leisure time, but not bigger ones.