I have a map with a shp file containing information on land use. The attribute table has over 10,000 rows.

I need to classify this information into 6 groups to represent 6 colors on my map. I know you can re classify by adding on a new column on the attribute table and put each row into the 6 groups, however this would take years to do 10,00 rows.

Is there a quicker way to do this?

Many thanks all

  • Welcome to GIS.stackexchange! Please provide more details on your data and an example of the classification criteria you intend to adopt. – steko Apr 12 '13 at 15:24
  • 5
    It sounds like you are contemplating manually editing 10,000 rows. Have you thought about a field calculation? What prevents you from doing that? If not a calculation, then what about joining a lookup table--is there any difficulty with that solution? (These are two of the commonest and most efficient solutions available in most GISes.) – whuber Apr 12 '13 at 15:38
  • I am not contemplating it, hence my post! – Steve Apr 12 '13 at 15:53
  • Whoops, pressed enter. I have never used either of the above, i have only just started using qgis. Which field calculation could i use to generate my new groups? In a nut shell, I have 25 subclass's which need to be condensed into 6 classes. – Steve Apr 12 '13 at 15:57
  • 1
    To repeat @steko's question then, how are you trying to classify them? Is this something where you can select a group of them on a map, then use the field calculator to set an attribute? Without knowing more detail about your data, and your goal, it is hard to determine what would work best for you. – Get Spatial Apr 12 '13 at 15:58

Case and when are currently only available in QGIS Master, which has some disadvantages for productive work.

I think you better make up a csv table outside QGIS, where you list the 25 group attributes in one column, and the 6 target ones in a second column. Supply field headers, add as delimited text to QGIS, and join by attribute your shapefile with that table on the first column. That should give you the 6 values in a new column.


a possible solution:

  1. open layer properties by right-clicking on the layer
  2. choose style tab
  3. choose rule-based rendering (left up; when you open style tab it's choosen single symbol renderer)
  4. enter the first symbol and type in the first rule
  5. enter the next five symbols in the same way.
  • +1 This is simpler than joining a delimited text file to the layer – underdark Apr 12 '13 at 17:32

I have a map in which I am only allowed 4 color groups, but data is 10-15 groups.

what I have been doing is coloring 6+ groups one color so I end up with the 4 color groups allowed.

Would that be something you can do or does the Data all have to be the same?

  • While this does work, it's not as well maintainable as a rule-based renderer solution. – underdark Apr 12 '13 at 17:33

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.