TransWikia.com

QGIS 3 : Produce classification on field where multiple values can be stored (comma separated value)

Geographic Information Systems Asked by Corentin Lemaitre on May 5, 2021

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

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP