Wednesday, 12 August 2015

style - How to use scale-rule based renderer in QGIS?


I wish to render a shapefile of buildings such that at scales below 1:5000, they have a border, and above 1:5000, they do not have a border.


For this, I went into layer properties, selected Rule-Based, and then selected the current Rule and then went to Refine Current Rules>>Add Scales to rule. After this I set the symbol for scales >5000, like I wanted.


enter image description here


Here is my layer properties.


enter image description here



You can see that there is an initial symbol. How Do I remove this? This causes problem because it is present behind the symbol; for example You can see the boundary here even though the scale is greater than 1:5000:


enter image description here


I have found that that if I remove the boundary of the first symbol(the one in blue), the layer appears as expected at scales >1:5000. This seems like a workaround rather than the straightforward procedure. What is the correct procedure to use scale -rule based renderer in QGIS?



Answer



You don't need a base/initial symbol in this case. Just remove it! You only need two symbols on the same level of the symbology tree.


You can use drag and drop to rearrange the styles:


enter image description here


If you rearrange them as shown in the picture, you can delete the initial one.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...