9

Not sure if this is what you are aiming to: (1) Select Graduate and choose "values" for Columns. (2) Set your Color ramp to Blues, perhaps (3) Click on Symbol: --Change... button to activate Symbol selector (4) Click on the small Epsilon button (i.e. Data defined override) right to Width (5) Enter suitable expression something like: (5 - "classes") * ...


8

The rules seem not to be correct. The first rule of your example is: "prcptot" = "prcptot" > 0 AND "p.prcptot" <=0.09 while I guess it should read: "prcptot" > 0 AND "p.prcptot" <=0.09 Stating "prcptot" = "prcptot"is a tautology, i.e. it gets always evaluated as true. The fact that it is chained with a > 0 before the AND operator might ...


7

You could add the main rule $id = $atlasfeatureid, without adding symbols: Then select and drag all the other rules over it (over the label part). They should then become dependent of this first rule:


7

Right-click on the layer from the Layers Panel and then go to Layer Properties > Labels and choose the label you want to use from the Label with drop-down list (after having selected the Show labels for this layer option). Then, go to Expression Builder and try to use a CASE WHEN expression. Something like this: CASE WHEN $area > 1600 THEN "...


7

Your formula goes to "label with" ... not in the "filter" field ...


7

If you use Single labels instead of rule-based, you could concatenate more than one field using ||. Couple this with an if statement, you could try the following expression: if("BBT_CODE" is not NULL, "Bio_Code" || ' / ' || "BBT_CODE", "Bio_Code")


6

Below some help to setup rule based labeling from scratch with the new QGIS 3 API #Configure label settings settings = QgsPalLayerSettings() settings.fieldName = 'myFieldName' textFormat = QgsTextFormat() textFormat.setSize(10) settings.setFormat(textFormat) #create and append a new rule root = QgsRuleBasedLabeling.Rule(QgsPalLayerSettings()) rule = ...


6

As alternate solution, instead of using rule-based labelling, you can put your formula in the normal labelling field like below.


6

The way to get QGIS to put sub-categories into a print legend is to make the sub-categories part of the layer's style. This means that converting your rule-based labels (with colored backgrounds) into part of the symbol style. If this method seems like too much work, see below for a rather hack-y workaround. Convert your categorized style to a rule-based ...


5

Since QGIS 2.16 there is now an inbuilt way to calculate the maximum value for a whole layer: maximum("fieldname") This will return the largest value in the 'fieldname' column for the layer.


5

There are several ways to achieve this purpose. You can always create rules for labelling, as you suggested, but you could try adding a new column to your file with the label for each desired class. This way is beneficial compared to creating rules, because the rules will be associated with your project file, and should you move your data elsewhere, you'd ...


5

Okay, your approach points in the right direction, but has the wrong syntax. Please note that you can test rules and that the help in the field calculator/expression builder is worth consulting. First error: = > instead of >= - QGIS doesn't know how to deal with two operators right after the other. Second error: "5" - things in " always refer to ...


5

You can use rule based symbology or data defined override. Since your case is not too complex, I suggest rule based symbology because you will have a nice legend then. Set it up the following: In case you want to use data defined override you can do it like this for example: Use as expression: Case When "Nest" is true then 'triangle' When "Nest" is ...


4

There's a (totally 100% unsupported) plugin at https://github.com/nyalldawson/topocolour which will add an attribute to your data which handles this. You'll need to manually download that plugin and copy to your .qgis2/python/plugins folder. It's not available in the plugin repositories.


4

The max function doesn't operate across features, just values passed to the function. Eg max(1,5,3) Will return 5. There's no function currently available which calculates the maximum value for an attribute across the entire layer.


4

QGIS uses one apostrophe for python string expression. Concatenating two text fields should be done like this: "FieldA" + ' ' + "FieldB" There is a space between the two single apostrophes. You can also use sa,e principal for integer or decimal values, so long as you use to_string() before the field name. Furthermore, you do not need to calculate a new ...


4

You just needed to use "=" instead of "is", surround your field name with "", and replace the () with '' around the offset values, see expression below: CASE WHEN "name" = 'Brooklyn Bridge' THEN '3.5, 0' ELSE '-3.5, 0' END


4

You should use a Rule-based renderer. Following your data, something like that: Click on the + button for adding a rule and then insert the custom expression (as indicated in the red box above). Remember also to click on the Apply button for applying the style.


4

In your case you would to represent size of the proportionality with a manual scale... It's not possible by this way as it show here What you have to do is to define your mathematic function with scale_exp as the size assistant method: Ex. coalesce(scale_exp(Number, 1, 11000, 1, 10, 0.3),0) Coalesce replace the first value not null by 0. First param: ...


4

Your code works fine. When you want to add a new rule, do not repeat the first 3 lines of code as this creates a new symbol renderer. Just start from root_rule = renderer.rootRule() ... And create your new rule. I find it easier to use a function like the following: layer = iface.activeLayer() symbol = QgsSymbol.defaultSymbol(layer.geometryType()) ...


4

Yes, either way (making expression with conditions or rule-based symbology) will work fine. As to the expression in the attached image, you could modify it to: CASE WHEN "feature" = 11 AND "label" = 'Existing' THEN color_rgb(255,0,0) WHEN "feature" = 11 AND "label" = 'Proposed' THEN color_rgb(0,255,0) WHEN "feature" = 11 AND "label" = NULL THEN ...


3

You could also use the following in the Python Console to change all expressions of each rule to $id = $atlasfeatureid: layer = qgis.utils.iface.activeLayer() renderer = layer.rendererV2() for rule in renderer.rootRule().children(): rule.setFilterExpression('$id = $atlasfeatureid') Edit: The above code replaces all expressions entirely. However, if ...


3

From QGIS 3, there is a new QgsRuleBasedLabeling Class which would allow you to control rule-based labelling using the new API. Rules can be added using QgsRuleBasedLabeling::Rule. (Unfortunately, I cannot test the 2.99 version at the moment. But I would happily accept an answer if it provides a working example.)


3

Now I understand your point. Adding subcategory to rule-based style is not working in QGIS 2.16.2, but actually it works using QGIS 2.14.6 long term release (LTR). Here is the output using Rule-Based Style without refine by subcategory: Here is the refine after adding subcategry: Only the subcategory economy under the category "Country" are styled. Since ...


3

You can set the Font Size to be a factor of the length of the geometry to be labeled and a number, so you would set your SIZE to an expression that uses length($geometry) * number note my data is in decimal degrees, which doesn't lend itself to a good example, but it does show that it works! Then the labels display as:


3

Well, if i understood your question the answers is this: You have to use "GEOMETRY (AREA) || GEOMETRY (PERIMETER)". Step_1 - Layer > Properties > Style > Categorized > E = Insert Expression ( AREA || PERIMETER)> ok... (In this step you can add more Geometry if you have in your table) Step_2 - classify > apply > Ok... Step_3 - Legend (On Layers Panel).


3

As far as I know you cannot. To achieve your result (not having overlaps of different symbols) you have to refine your rules to exclude this possibility. Such as: "TOPO"=1 AND "COVER"<> 1 For your base symbol (Other), you should use the rule: ELSE Indeed, the way it currently works is useful if you want to superpose information or create more ...


3

This should work Name LIKE 'NRG%'


3

What you seek, can be easily done using the atlas features in the print composer. No need for clippings or filters. Specially if done one by one... Create a map layout according to your needs; Add, at least, one map item; In the atlas generation, use the country shape as your coverage layer. At the map item select the controlled by atlas, and set a value ...


3

What version of QGIS are you using? I'm using 2.8 and I can style a layer by 'name' and also label it, and then turn off one of the features in the layer with a checkbox in the legend, and it isn't labelled any more.


Only top voted, non community-wiki answers of a minimum length are eligible