3

Using QGIS3, I'm making maps with proportional circles based on an attribute value (integer). When this attribute is NULL, no circle is printed, which is what I expect. When this attribute is 0, a circle with size 1 is printed ; it should not.

I can't find any option to solve this. In my sources, values are considered from 1 to 20 (max value). I tried with 0 as min value, it's the same. There is an option to set size when value is NULL, but not 0.

I could set all 0 values as NULL, but i need the 0 to make operations (as sum).

Is there a way not to print circles on 0 values ?

1
  • You can set the 0 values to null maybe?
    – Fee
    Dec 12, 2020 at 13:48

1 Answer 1

5

You did not state where and how you create the circles, but from the description I guess you use the size assistant. Simply set the output value to 0 as well, not just the source value:

enter image description here

Other method is to use an expression. You can adapt this solution if you do your circles somewhere else.

Instead of the value of your attribute, use an expression like this here that sets all 0 values to NULL and leaves all others unchanged. Your original data remains unchanged, the expression works just for the creation of the circles. In this example here, I set the size of the circles based on an attribute named "radius". if ("radius"=0, NULL, "radius")

As you can see in the screenshot, points labeled with 0 do not appear (radius = 0, highlighted with red boxes):

enter image description here

Creating circles with the geometry generator works without further adaption, points with 0 values don't draw as circles (or 0-size cirles, a 0 dimensional point):

enter image description here

2
  • Indeed I used the Assistant. I can't use the first method you proposed because I want my circles with value 1 to have a size of 3. The second method works perfectly for me. Thanks !
    – Cupain
    Dec 12, 2020 at 15:20
  • 1
    Also consider using the transformation curve, where you can manually fine tune the scaling from min. to max. size
    – Babel
    Dec 12, 2020 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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