2

I am working in QGIS 3.8.3-Zanzibar on a shapefile with polygons.

I am zoning by selecting the polygons and giving each group a different number (a zone code).

In order to visualize it, I have a Category Thematic map with the zone number, so I can easily see the different groups I am creating.

zoning progress

But, as I keep on making groups (that is, giving other zone codes to the polygons), it is hard to visualize the result unless I manually update the thematic map.

I would like the map to dynamically change its colours as I change the zone numbers. Until now, I have to re-classify the categories of the thematic map, as it only classifies with the existing numbers (zone codes) but the new ones I give out, the all go to the group of "all other..."

categories and "all other..."


Here I am going to show my work routine with sample data, as suggested:

  1. Initial shapefile with polygons. Visualization is simple symbol.

1

  1. Visualization with a Category thematic map depending on the zone number (last column of my table).

2

  1. I select some polygons and change their zone number.

3

  1. The visualization has change according to the new zone number of the polygons.

4

  1. I then change other polygons zone number.

5

  1. The visualization changes again, but with the same colour, because any other zone numbers are classified as “all other”.

6

  1. I would like to have this visualization without having to manually update the categories of the thematic map.

7

I don't know how to upload shapefiles, in order to provide the sample data, but here it is a screenshot of my table (it really only matters the last column).

Table

2
  • I tried to explain the routine better, but I don't know how to provide shapefiles. I hope the new images help. Thanks a lot.
    – Pescariz
    Commented Jan 3, 2022 at 10:12
  • What is range of the zone numbers? Commented Jan 3, 2022 at 16:29

2 Answers 2

2

A workaround would be like this:

  • In Style Panel, type $id for "Value".
  • Click on "Classify" button. This generates separate symbols for each id.
  • Change $id to ZoneID.
  • Now, there is a color for each zone id. I assume that the range of ZoneIDs is the same of the feature ids. You may need to refresh map canvas (F5) to see the result.

enter image description here

0
0

To avoid manually updating the categories, simply click the Classify button each time you made a change:

enter image description here

2
  • If I do that, I get the same colour as before, plus I was trying to avoid the manually click (I have many zones to change). I was hoping there was some sort of dynamic update of the thematic map.
    – Pescariz
    Commented Jan 3, 2022 at 10:30
  • This should be possible using PyQgis - however, due to the policy of this site, questions asking for Python should include some code attempts.
    – Babel
    Commented Jan 3, 2022 at 10:33

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.