2

In QGIS, I have been learning a few expressions to style my trail maps but still know little and am stumped on what to use to filter my symbol data.

I am showing Parking locations on my map. I use a marker symbol as a background element, so I can do callouts. I created a data field and added values to display beside this symbol a number that references a list of parking addresses in the book's text.

All good except if the field has no number to display, it is NULL, it does not display my marker symbol. I need to filter this, so it does show even when there is no value in the field.

1
  • What kind of symbology did u use for the layer ? The Marker should appear even if your data field is null unless u used a rule-based symbology taking that case in account.
    – Snaileater
    Apr 4, 2021 at 9:59

2 Answers 2

1

So ... you are using a rule-based symbology.

I think you could try the following (even if we don't see the rules you use) :

Instead of "PLot" only try to label your sites with coalesce("PLot",'') that should enable you to handle NULL cases.

A second possibility could be to elaborate the rules of your symbology a bit more in order to exclude these NULL cases. (that means test your values using IF conditions)

2
  • Coalesce condition did not do it. The User Guide mentions "Returns the first non-NULL value from the expression list." So it seems it needs to see a value instead of NULL to work.
    – Dan R
    Apr 7, 2021 at 10:32
  • That's the aim of the expression ... if your PLot data is NULL then return a blank space ... i don't see the use of manually replacing your data ... are u able to share your project and some or all of your data ? at least your .qgs file ?
    – Snaileater
    Apr 7, 2021 at 10:45
1

Modify the data in PLot to contain a space instead of a Null. Then the problem may go away. Or use a ? to indicate to the viewer that the number of the lot is unknown. That may be important. Features without attributes are usually not as good as features with attributes.

3
  • In the end, I could not sort out how to filter my attributeless Parking icons to display. I agree they should ALL have a reference attribute to aid the map user in finding the addresses listed in my text. So I am moving on and may yet solve this some other day. For now, I can tailor my maps to work.
    – Dan R
    Apr 7, 2021 at 10:40
  • saying "now my map works" without indicating the way u solved it is all but useful on this kind of help site ..
    – Snaileater
    Apr 7, 2021 at 10:48
  • Well as wingnut had eluded perhaps I should not seek to show Features (my Parking Icons) with no reference numbers. And I agree they all should have a # to reference my list of street addresses listed in my text. So this was a solution for me, as I avoided the posted issue, granted not a solution to the problem. (Sorry, I am on a tight deadline and I need to move forward on this project.)
    – Dan R
    Apr 7, 2021 at 15:44

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.