2

I have a multypolygon-shapefile of government districts in Germany with two columns, "population density" and "yesno": The first has integer the second one Boolean values. I have already colored the map using the population density values (Symbology - graduated). Now I'd like to use the second column (yesno) for symbology as well. I want to put one of two symbols (one for true and one for false) on every government district. I know how to use icons for points, but not for polygons. And I know how to color based on one column, but not two for the same layer.

How can I use an icon for a polygon without losing the earlier classification?

0

There are several options, which have different effects on the legend rendering.

Here is one of them:

1) Edit the graduated symbol

enter image description here

2) Add a centroid fill. Click the + icon, select the new style, set the symbol layer type to centroid fill.

It will create a centroid fill / marker / simplemarker style.

enter image description here

3) Click the simplemarker. Under symbol layer type, select SVG marker.

Below svg group, click the epsilon button to the right, select edit

enter image description here

Based on the yesno column value, use one SVG or the other. Enter the full path to your file. Click OK.

if("yesno"=1,'C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./svg/accommodation/accommodation_bed_and_breakfast.svg','C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./svg/accommodation/accommodation_alpinehut.svg')

4) IF the SVG you are using can have its color customized, you need to use a fixed color else it will be set to the same color as the polygon (i.e. it won't be visible):

Near the top of the SVG Marker panel, click on the epsilon button near Fill Color, select edit

Enter a constant color, like 'black' or a color code. Click ok.

5) Back to the graduated layer styling, classify again the data. The new symbol (color + icon) will be set to each class

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.