To explain what I want to do the best is a simple example. I have a layer with point for audio geolocated notes. The attribute "type" can store different values : "problem", "surface", "question", "to_osm" or combination of these values.

Now to do style the layer in QGIS I use a rule for each type : "type" ILIKE '%problem%'.

After I have created each rules I could interact with notes and choose to see, only one or multiple types. enter image description here

This solution work well for me since more than 2 years. It is a DIY patch that take time to do and could be easily broken (rename column). I think that this problem was common on GIS data representation.

Yesterday i have found out that solution to build style direct from data exist. With the Lizmap (a webgis solution based on QGIS server), the form filtering feature you are able to set a separator for a field containing multiple unique values. LINK and extract :

If you have specified a splitter text, for example , , Lizmap will find the unique values of the separated text values. For example the value of one feature culture, environment will be split into culture and environment with the splitter , . Selecting culture or environment in the form input will show this feature.

I am asking is there a better solution to do classification of a field with multiple values based on QGIS styling rules ?

PS : I have tried also other solutions based on data structure modification (i use it sometimes) :

  • create a column for each type and fill it with boolean : hard to maintain the styling and edit data
  • create relation n to n : hard to make it work and then share it with others
  • duplicate features for each types : hard to edit the rest of the data
  • I don't clearly see the backdraws of your current symbology nor i see the benefit of splitting your 'type' attributes ... i'm not sure you can ever think of a symbology that would not be dependent of your table structure and naming ...
    – Snaileater
    Commented Apr 17, 2021 at 9:25
  • Hello, the backdraws are mainly comfort and reproducibility : manual action is needed to build style (there is about 10 to 15 class). I am seeking for clean solution because I know it is handeled on Lizmap. Commented Apr 18, 2021 at 10:58
  • Your link refers to Lizmap's form filter and the way it scans the attribute table content to filter features ... i don't see what could be applied in it to symbology.
    – Snaileater
    Commented Apr 18, 2021 at 12:36
  • As the filter does the split of column content it could then be feed to the classification styling of QGIS. Commented Apr 18, 2021 at 14:12
  • splitting/not splitting is almost not the question : how would u find a logic that is not dependent on your data's structure ? since it seems that's what you're seeking.
    – Snaileater
    Commented Apr 18, 2021 at 14:35


Your Answer

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

Browse other questions tagged or ask your own question.