For a simple species distribution map for the Dutch Wadden island of Terschelling, I want to give each 500x500 m polygon (reference grid = EPSG 28992) a specific color that coarsly corresponds with the underlying vegetation/habitat type.

In the pictures you can see what I mean: The first map is one that I want to use as reference (of course I can also use sattelite photos) for vegetation (the dots represent the dispersion of a species and the polgons are vegetation types). The first picture was my initial idea, but since the maps will be displayed on a small scale in a book, i reconsidered and went on to the second picture. Here i added a vector grid of 500 x 500 meters and used the TomBio addon to convert the point shapes to 500x500 points corresponding with the grid. In the second picture I also added colours for vegetation types (e.g. yellow is beach vegetation, purple is heather vegetation, green is dune meadow etc.). I did this by just eyeballing the underlying map and give each polyon the colour I thought was right.

My Question Is there a way of automatically generating pre-determined colours to polygons based on the vegetation in that polygon. i.e. a polygon consists of 80% forest, 15% dune meadow and 5 % heather, the polygon will be coloured dark green because most of the polygon consists of forest. This seems to me a better way then just eyeballing a polygon, but I can't figure out how to do it.

Note: I really want it to be a very simple map. So no subdivisions in forest or dunemeadow types etc. The classes i want are: -Forest (dark green) -Beach and dune (yellow) -urban (gray) -Polder (red) -heather (purple) -dune meadow (light green) -Salt marsh (Brown)

So more of a habitclassification based on the (in some cases absence of) vegetation.

enter image description here


(in case you don´t have a classified image already and/or if that´s new to you)

Try the Semi-Automatic Classification Plugin, you find the user manual and some examples/tutorials here. The general steps are to

  • enhance spectral signature/general image preprocessing:
    Especially multi band imagery should be spectrally cleaned and enhanced in advance, but you could try to preprocess your base map in terms of e.g. color space. See what´s fit for you and try the options.
  • create sample areas/ROIs:
    Basically you mark areas on your reference map that corresponds to the vegetation types you want (simply try and find areas where e.g. forest is as clear in color as possible to start with. there are more sophisitcated ways to map samples, you can read about them in the manual). The purpose in multi band imagery is to create isolated spectral footprints for the algorithm to distinct.
  • run the classification algorithm:
    Well...do it. Try the Maximum Likelihood algorithm first, it might give you some good results to start with. Read about it and other algorithms in the manual.

Zonal Statistics:

The resulting classification raster can then be used to compute the majority of distinct values per overlaying polygon with QGIS' Zonal Statistics tool;

In the GUI simply select both the resulting raster and your polygon layer and choose majority (and others if you want) to let the tool add those values as attributes to the selected polygon layers' attribute table (with prefixed columns if you want).

Use these attributes to apply the color scheme of your choice to your polygons via layer properties -> style

  • Thanks for the comprehensicve explanation. Still tweeking the image i want to work with, but in time this will be as I want it. – Tom van Heusden Jan 12 '18 at 16:06

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.