2

This question centers the Symbology tab in QGIS 3.0.

I'm working with categorical data describing event venues in the Chicago area. This is a point dataset which will be overlayed on a street basemap.

  • Bars
  • Nighclubs
  • Theatres
  • Parks
  • Restaurants
  • Galleries
  • Other

I would like to use the Symbology tool in the Properties window to display "Bars" specifically in red, and "all other values" (nightclubs, theaters, other, etc.) in yellow.

The attribute field I am using is called "Type"

Fundamentally, I have solved this problem using the following process:

  1. Symbology
  2. Column Drop Menu -> Select "Categorized"
  3. "Formula" button
  4. "Type" = 'Bars' (syntax)
  5. Select "Classify" button
  6. Outcome: classifcation of "0" represented in Yellow, and "1" in Red. "1" = "Bars", "0" = "all other values/anything that is not a bar"
  7. Change Legend entry for "1" value to read "Bars"
  8. Change Legend entry for "0" value to read "All Other Venues"

Indeed, this process solves the problem of isolating the desired value and representing all other values.

I would however like to clarify... is this the only way to isolate one value and represent all others? Many of the folks I work with are coming from the ArcMap 9 and 10 environments, which make this process super easy using selectable options in the GUI rather than formulas.

Have I missed a GUI method of completing this task while solving this problem or should I start working with formulas?

  • 1
    You could add a column to your attribute table, indicating how each point is to be displayed. You could create separated layers for each type of venue. You could use rule-based symbology. Sure, you have to stick to formulas, but they aren't complicated. – Erik Jul 30 '18 at 10:10
1

Another way of catching all other values is using ELSE. There are two ways:

Method 1

Use the Categorized symbology as you did.

Categorise by "Type" and make sure you leave the last entry there (which will have no value or legend). It actually says ELSE, which is basically a way of saying "everything not covered by the previous logic".

So if you delete the symbology for everything other than Bar and that last entry, you will gradually see all the other non-Bar features styled in the same way.

In the example in the screenshot below, if you wanted to keep High and lump everything else under one symbology, just delete as shown and keep that empty category:

enter image description here

Which will result in this - and you can rename that last category anything under Legend, just do not type anything under Value (don't even type ELSE as it will literally look for a "Type" that is 'ELSE', which is not what you want)

enter image description here

Method 2

Use rule-based symbology (perhaps set it up in Categorised, then switch to Rule-based to see the underlying rules).

Set one rule up for "Type" = 'Bar', and another for ELSE (see screenshot below - in 3.x it's now available as a checkbox and you don't need to type it in)

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.