3

I'm trying to reclassify a slope layer into four or five categories. r.reclass won't work for me (see Execution Failed error running r.reclass) so I have been trying an alternative method - 'reclassify by table'. I can get it to run but every time I do it, I get an output that doesn't seem right.

The slope output from QGIS is good (see picture), but the reclassification results in something very 'bitsy' and largely homogenous (see picture) instead of what I expect (and what I am after!) which is four/five distinct categories.

Am I missing something obvious here or is there a trick to this I don't know?

I've played around with the symbology to try and match them fairly closely - and yet the result is wildly different.

I want to have zones of slope category (low/med/high/v.high etc) that I can convert to polygons later if I wish.

Drawing polygons by hand is horrendously time consuming and clearly not an ideal solution.

Values inputted Slope symbology

PolyGeo
  • 65,136
  • 29
  • 109
  • 338

1 Answers1

1

It might just be your visualization if the "Symbology" window in the lower image is referring to your shown reclassified result. Try changing Max to 5, or use "Paletted/Unique values" option as Render type instead.


It turned out that r.reclassify requires integer rasters, not float. A possible solution is described in How to reclassify a float raster?.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
malin-fischer
  • 480
  • 2
  • 8
  • Thanks for responding. Unfortunately that isn't it. As you can see from the two images the variation in each is wildly different. If the colour classes was the problem then you would see broadly the same pattern. I've tried changing the symbology but the actual reclassified data appears to be structured differently - hence the different result. – ActionEcologist Jul 08 '21 at 20:20
  • So I went back and fiddled a bit with this, and maybe you're on to something after all. ;) ..when I looked at paletted/unique values the first time I was put off by the fact there appeared to be thousands of unique values up to seven decimal places from 10 thru to 90 (instead of just six categories: 0-5). When I looked at it more closely I saw that 0 thru 5 were also there. So I just coloured those and I got something more like the original. How do you exclude all those other thousands of values?? – ActionEcologist Jul 08 '21 at 23:00
  • ...but I don't understand why it didn't work the same way as I see all the examples/tutorials on YouTube etc.. i.e. I didn't get just five categories (like this: https://www.youtube.com/watch?v=7eIFvZ4fU6k). He can use symbology to singleband pseudocolour equal interval just fine and it works. – ActionEcologist Jul 08 '21 at 23:28
  • I found this post describing a similar problem and solution. r.reclassify requires integer input, not float! Try to follow the suggested solution (or experiment with the raster calculator instead). – malin-fischer Jul 09 '21 at 08:38
  • Thanks for the suggestion.. is my slope map input "floating data"? Maybe it is, but nobody (in any of the tutorials I've watched) have needed to do this.. so I'm not entirely sure why I would. Shouldn't reclass be able to handle this without conversion? There are no negative values or stuff like that in there anywhere I wouldn't think. I'm not entirely sure why I need this.. isn't using the 'raster calculator' just doing what reclassification should be doing? – ActionEcologist Jul 11 '21 at 21:37
  • Here you can find the official documentation of r.reclass - it says: "r.reclass only works on an integer input raster map; if the input map is instead floating point data, you must multiply the input data by some factor to achieve whole number input data, otherwise r.reclass will round the raster values down to the next integer." Maybe try this? It's developed to work on categories, so that's probably why it uses integers, not floats. – malin-fischer Jul 12 '21 at 08:28
  • It DID work though... just not the way I had anticipated. – ActionEcologist Jul 13 '21 at 20:47
  • to clarify.. r.reclass fails every time.. reclass by table 'works' but the output is weird. ;) – ActionEcologist Jul 14 '21 at 21:38