|Single Band Raster Layer Symbology in QGIS|
In this tutorial, you will be given a sample single band raster layer and will use the pseudocolor and custom colormap options to symbolize it. A single band raster layer means the image contains one band.
Download the ArcInfo ASCII grid file (.asc extension) here and open it in QGIS using the “Add Raster Layer” button .
Right click the Raster layer and choose “Properties”.
Under Render as, you will notice “Single band gray” is default selected. This is because the raster contains a single band. Under the Single band properties, the Gray band will be “Band 1” and it will be the only option because there is only 1 band.
For an easy and effective way to visualize your raster layer, choose “Pseudocolor” under Color map. Pseudocolor is a color ramp that ranges in color from red for high values, yellow for mid values, and blue for low values. This is often referred to as a heat map and used for hotspot mapping. Note that you can choose to “Invert color map” to flip these colors (ie. blue for high values, and red for low values).
You can also choose to “Use standard deviation”. This is used to only show the values of the raster layer that fall within the specified standard deviations from the mean of the layer. You should only use this option if there are outliers in your data that have a detrimental impact on the visualization. Tweak this number according to your analysis needs. In this case we will not select this option.
Click OK to set the symbology.
To set custom colors for your raster layer, re-open the layer properties and change the Color map to “Colormap”. This will make the Colormap tab available.
Click the Colormap tab. The first option is "Color interpolation". By selecting discrete you can classify a range of values into a single color/map class. The Linear option will create a smooth transition between colors specified in the colormap. The Exact option will only display colored cells that have the exact value specified in your map classes.
Below is an example of using 5 discrete classes.
The first value defines the first cutoff. I have specified this to be 220. This means any cell that has a value below 220 will use the first color. The last value defines the highest cutoff to be used in the map classes. This is usually the max value in your raster. Below is the output from these settings.
Using the same map classes, but changing the Color interpolation to Linear produces the following results:
You can add map classes by clicking the “Add Entry” button. Double click the Value to adjust the cutoff for a particular map class. Double click a color to open the “Select Color” dialog and choose your color or provide RGB values.
You can also classify your raster layer using the Equal Interval technique. Equal Interval is used to divide the map classes into equal sizes. The number of attribute values is divided by the number of map classes and this is used to determine the cutoff values for each entry.
Under “Generate new color map”, set the Number of entries to 10, the Classification mode to Equal Interval, and click the “Classify” button. You will notice 10 map classes with values and colors were auto-populated for you. Click the OK button to view the changes.
If you want to use specific colors for certain pixel values, set the Color interpolation to “Exact”. This method is used to specify the colors for exact pixel values and only those values.