I have a raster with a wide range of float values, and I'd like to reclassify it based on pixel distribution (Class 1 being bottom 25% of pixels, Class 4 being top 25% of pixels, etc).

I've been using the r.reclass (Grass) tool within the processing toolbox, and it allows for a 'reclass' text file to specify ranges. However, I'd like to automate this process within a model, so making a custom text file for each map isn't plausible.

Are there any other options for reclassifying based on pixel ranges?

So far, it seems that r.quant does not work, and r.quantile only outputs an html file, and not a usable txt file. r.recode may be an alternative to r.reclass, but it hasn't been working with the output from r.quantile. Still no solution.

  • 1
    do you mean you want to find quantiles/quartiles instead, rather than equal interval? – Steven Kay Dec 19 '16 at 21:50
  • Honestly, I'd like to be able to do either or. It seems the only method for preparing the 'reclass.text' file is using hard numbers (ie. 10 thru 100 = 1), and not percentages (ie. 0% thru 10% = 1, 10% thru 70% = 2, etc). I haven't been able to find any documentation on flexible syntax for that document, so maybe there is a better QGIS reclassification method out there? – GIS_Canuck Dec 20 '16 at 18:15
  • type in 'quant' into processing search, under models do you see Models > Example > Quantiles? I seem to have a model already but not sure if it comes with QGIS or is something I wrote a while back and forgotten about... couldn't find it in the qgis repos. – Steven Kay Dec 20 '16 at 19:11
  • @StevenKay I do have an r.quant, which seems like it should do the trick. Thank you!! – GIS_Canuck Dec 20 '16 at 20:02
  • yeah, I just saw that too! if you can get it to work, please do answer your own question, would love to know how to do this. (I'm sure I've done this analysis before, but I may have used my own code). My model seems to no longer work, it seems to want to run grass 6 which I no longer have installed :/ – Steven Kay Dec 20 '16 at 20:08