The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [rule-based]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
2answers
240 views

QGIS style polylines with alternate colours

I have a bunch of shapefiles with multiple polylines. Each consistst of 5 up to 30 polylines. I would like to define a style which colours them alternating two colours. When I use the Categorized ...
5
votes
2answers
4k views

Rule-based labeling in QGIS

I'm trying to label visited countries in a world map shapefile, what is wrong with my rule : if( "Visited" = 'yes', "NAME", NULL)
1
vote
1answer
520 views

Managing rule-based renderer in PyQGIS?

This is my first project in QGIS and I'm also quite new to Python. PyQGIS is more than a challenge for me! I found code in How to programmatically set a rule-based renderer in QGIS? to set a rule ...
2
votes
1answer
206 views

Multiple rule based expressions with 2 layer styles in Atlas

I have 18 transects over a geographical extent and I am applying atlas to display a map for each transect. All is going well and I'm venturing into expressions and rule based rendering $ID = @...
1
vote
1answer
155 views

How to treat PosgreSQL array fields in QGIS rule-based styles filters

In a PostgreSQL/PostGIS DB I have a table with an attribute declared as a 1-dimensional integer array INTEGER[] holding a value like {1,2,3,4,5}. Now I would like to build a rule-based style and need ...
2
votes
1answer
132 views

Categorizing multiple values_multiple atributtes - QGIS 2.14

I have a problem with a polygon layer. Its an equipment and services layer... I want to aggregate different types of services in similar legend, like this: For example, these four : "Ensino ...
2
votes
1answer
246 views

Categorizing multiple entries in QGIS?

I am trying to categorize a polygon layer with several buildings, by the number of floors. I want to aggregate by classes like this way: 1 floor = 1 to 2 floors; 2 floors = 1 to 2 floors; 3 floors = ...
8
votes
1answer
217 views

cumulative atlas in QGIS 2.14 and above?

I have a question about something which I think is possible but just can't get my head round it, and haven't found any answers online. I'm using $id= @atlas_featureid in QGIS 2.14 to create an set of ...
3
votes
2answers
356 views

Label OSM polygons above a certain size?

I'm wanting to label polygons on a map that are above a certain area. These polygons are dervied from open streetmap and consist of either ways or multipart polygons ie If polygon is more than 160 sq ...
15
votes
3answers
1k views

Controlling rule-based labelling using PyQGIS?

Following on from this question: How to turn on/off all labels of all layers in QGIS, OP mentioned in his comment that he uses rule-based labels. I tried searching online as to how these types of ...
4
votes
1answer
191 views

How to return array from label offset expression? [duplicate]

I am trying to set the x,y offset of layer labels based on a data defined override. What I'm trying is the following: CASE WHEN name is 'Brooklyn Bridge' [3.5, 0] ELSE [-3.5, 0] END However this ...
5
votes
2answers
482 views

How can I apply a style rule to multiple categories? (2.14 and above)

I think this used to be more straightforward in earlier QGIS versions, but with more powerful rule-based styling (great development) I am now a little confused as to how to apply a rule to multiple ...
4
votes
1answer
171 views

manage qgis rule based styling duplicates

I am new to qgis. When I am using rule based styling, duplicates for some reason show all the matching symbols and not only the first match rule's symbol. How do I make show only one symbol even if it ...
3
votes
3answers
2k views

Categorization with multiple values- QGIS 2.18

I'm trying to represent 2 columns in polygon layer. I've tried to do it with the rule-based style but didn't understand how to do it. This is the attribute table of the polygon: I've tried to use ...
2
votes
1answer
214 views

Create rule-based renderer from an existing renderer using PyQGIS

I want to make a copy from an existing layer in the legend and render it with a rule-based renderer based on the original layer's graduated symbol renderer. Then I will change its rule expressions, ...
1
vote
1answer
1k views

QGIS: Style-“Rule-Based” [closed]

Style: Rule-Based Please be informed that the Add Categories to Rule under the "Refine Current Rules" does not filter in accordance to the selected layer that you have chosen. Instead, all ...
2
votes
1answer
239 views

Is it possible to show all label on a polyline layer with minimum overlaps, by automatic changing of the font size?

My goal is the following: I would like to show every street name/label, without overlapping (the scale I use is <20000, and it is changing). The default label is curved, 8p, but if the software ...
3
votes
1answer
238 views

How to automatically assign specific ColorBrewer ramp to polygons so that no touching polygons share the same color in QGIS 2.16

I'm creating a series of reference maps that need to differentiate between administrative regions within a country. I created a new color ramp using ColorBrewer Dark2 with 8 categories. My ...
2
votes
1answer
209 views

Can I specify half-open scale ranges in rule-based QGIS layer styles?

In QGIS 2.16.1's rule-based symbology as well as in its rule-based labeling, it's possible to enable a "scale range" to which the visibility of the result of the respective rule (be it a symbology ...
3
votes
0answers
68 views

SOL help in QGIS: rule based styling to show timestamp increase via gradient

I have some polygon data from a tractor that shows it's route among other things. It has a timestamp column which I'd like to use to show the route in which the tractor drove through the field via a ...
2
votes
1answer
379 views

Rule based polygon fill in QGIS?

I'm really quite new to QGIS, I want to style polygons fill with raster imagws based on a attribute contained in the property table. What do I have to write in the description in order to get for ...
2
votes
1answer
76 views

Rule-based rendering of one line with two line styles

I need to show parts of a network, which meet two criteria at the same time. So I would like to use the style of criteria 1 and the style of criteria 2 side by side (see picture). The problem is, that ...
1
vote
0answers
48 views

QGIS .shp joined to xlsx.vrt; Classify works, Rule-based does not

Very simple set up. Tiger .shp file as a layer. Has a join to an xlsx non geo attribute table as a .vrt .shp has join on MTFCC to MTFCC in xlsx.vrt. xlsx.vrt, has a string field with a brief label ...
2
votes
1answer
574 views

How to write a string based rule, e.g. If “Name” contains 'NRG'

I have created a field called 'Name' in QGIS and I wish to create a rule-based style for a gridded vector. The grids are either 'NEP1' or 'NEP1NRG' etc. with values to 5000+. I want a rule to colour ...
1
vote
1answer
630 views

Rule-based labelling in QGIS - problem moving labels

I have just started to use the Rule-based labeling feature in QGIS but am not able to move the labels - x and y coordinates are defined
1
vote
1answer
96 views

QGIS Labeling OSM items depending on scale

I'm working with OSM data in QGIS 2.10 (Ubuntu). I'd like to label items depending on scale. What I mean to do is to have only labels of "primary" roads from a scale of 1:80.000 down to 1:50:000 all ...
3
votes
3answers
327 views

Show all points (airports) in featured country only

I need to generate maps showing all airports located in a featured country. My airport shapefile has over 8000 points, so I need to remove those that are irrelevant. Example: When Sweden is featured, ...
1
vote
2answers
255 views

How to make QGIS label only the shapes that are showing up?

I have a layer where shapes are defined by rules (country) and secondly by categories (a type). I then select (check box) the country to show the shapes only for that country. This works very well, ...
2
votes
2answers
163 views

Rotation field is missing in rule-based renderer in QGIS 2.6

I am trying to do rotation of point symbols in QGIS. I am working with rule-based renderer. In other types of classification there is a button advanced (for example in categorized renderer), where I ...
1
vote
0answers
118 views

C++ QGIS Conditional Label Colouring

I am using QGIS and C++. When I create a layer of polygons with labels in the center I am able to use a RuleBasedRenderer to control the background colour of the polygon. How do I similarly control ...
2
votes
1answer
479 views

How to change rule-based Layer Styles all at once in QGIS?

Let's say I have a layer with buildings which is only shown when the scale is higher than 1:10000. When the scale is higher than 5000, I want them to show its function color (retail, residential, ...) ...
1
vote
2answers
1k views

QGIS Rule Based Rendering

I am looking for an example of how to use the QgsRuleBasedRendererV2 to filter features of a layer based on an attribute value (0 or 1). Has anyone done this in Python or C++?
3
votes
3answers
3k views

Using 'max()' in expression with QGIS?

I want to make a rule-based style on the maximum value from a field. I set my expression like: max("fieldname") It returns every value instead of only the maximum one. Can anyone tell me the right ...