I have run the viewshed plugin in QGIS to query which areas of ground any of my target points might be visible from. The result of this query is a raster tiff file with 'Band 1' value = 0 where no points can be seen, varying right up to 'Band 1' value = 172, where all my points can be seen.

I want to display this raster showing all the areas of Band 1 = 0 (no visibility) as white, and all the areas where Band 1 >=1 as one solid colour, to show that there is some visibility of my points (regardless of how many or few are visible).

I had thought this would be straightforward to achieve within the style settings of my layer properties dialogue for the raster - I have set this to display single band pseudocolour for Band 1, and added 2 classes, one for <=0 (white) and one for >=1 (green). However, this shows all the 0 areas on my raster as coloured green, and all the visible areas as white?! I've tried to just swap the colours (setting <=0 to green and >=1 as white, though this doesn't make sense to me) to get it to display the way I want, but it then defaults to the entire raster displayed as one solid colour.

Is there something obvious I am missing? I am used to display properties in ArcGIS and don't have much experience with the QGIS settings, but this seems strange to me.


1 Answer 1


There's a few settings you might need to alter:

  1. In the Load min/max values option, choose the following setting:

    Min / max
  2. Set the Accuracy option to:

    Actual (slower)
  3. Set the Interpolation option to:

  4. Set the Mode to Equal interval and the Classes to 2. Then set your colours and values like the following:

    Value <=    Colour    Label
        0       (White)   <= 0
      inf       (Green)   > 0

Here is a screenshot of the options I used:

Raster properties

  • Thanks for your help - these settings still give me one solid colour raster though? Not sure where I'm still going wrong! The only thing I've noticed different to your screengrab is under 'Band' mine is set to 'Band 1' (which is correct, as when I query the raster the values are here,) but it's actually stated as "Band 1 (grey)"? Not sure if the grey part is affecting my edits to the display colours.
    – lisagravy
    Commented May 11, 2017 at 9:50
  • Interestingly, playing around with this, if I use these exact settings but use 1 instead of 0, I get the correct display settings. It's just as soon as I change it to 0, the entire raster goes one colour. I've tried <1 and <0.99999 too, but the entire raster still goes one colour. My issue with using 1 is that it will show as white areas where one of my points is still visible, thus underemphasising potential visibility?
    – lisagravy
    Commented May 11, 2017 at 9:57
  • 1
    It's fine, I've got there! I've actually had to have 3 classes - one for 0, one for 1, and one for inf. Both 1 and inf are set to green, and 0 is set to white. No idea why I can't just have two classes! Irritating. Anyway, thanks for your help.
    – lisagravy
    Commented May 11, 2017 at 10:00
  • @LisaSH - Indeed that is bizarre! Unfortunately, I can't confirm the behavour (I'm using QGIS 2.18.2 on Win7 64-bit) and testing it on the raster I have seems to work fine. Perhaps it is related to "Band 1 (grey)" but glad you got it working :)
    – Joseph
    Commented May 11, 2017 at 10:02
  • 1
    Hmm, I'm on 2.18.2 as well but on mac OS Sierra. Maybe just operating system glitch. Thanks! :)
    – lisagravy
    Commented May 11, 2017 at 10:06

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.