[GIS] Styling discrete raster using QGIS

qgisraster

I have rasters with discrete values (Landuse categories, boolean values…). I would like to be able to style them in a discrete way:

0 -> Red
1 -> Blue
2 -> Green
...

I wish something like the "Unique Categories" in ArcGIS: http://resources.arcgis.com/en/help/main/10.1/index.html#/representing_unique_categories_such_as_land_use/009t00000074000000/

However, all the options I see involve color ramps… Have I missed something?


I've opened a feature request, since there seems to be only workarounds available, not solutions: http://hub.qgis.org/issues/14845

Best Answer

You can create a customized style scheme, something like unique categories but you'll have to add all the categories manually ( Atleast I have to, but I'm using an older version of QGIS ).

Right click the raster -> properties -> style. In there choose singleband pseudocolor as the Render type and click on the little red plus to add your own values and corresponding colors. Something along the lines of: enter image description here

Note that you can also use classify to get the values automatically but if you have discrete values you might be better of just adding them manually, depends on how your data is distributed.

If your data follows a pattern, if it is 0,1,2....10, you could set the Mode to equal interval, define the range Min:0,Max:10 and Classes:11, click Classify and you'll get all the values automatically. Then you could alter them as you see fit. enter image description here I know it's not perfect, but this is the best I've found so far. There might be a plugin that deals with this issue.

Related Question