[GRASS-user] Raster classification by typical methods?

Hello user list,
I have a question concerning raster works:

classifying in by typical methods

How can I create a reclassified raster from another raster with
continuous values where the classification follows the following rules
* equal steps (a class break every 100 or 50 [mg/m^2])
* equal interval
* automatically classification based on defined number of classes

It would be great to receive some helpful hints and tips on above
outlined question.

Kind regards and thanks in advance,
Timmie

On 29/03/13 16:02, Tim Michelsen wrote:

Hello user list,
I have a question concerning raster works:

classifying in by typical methods

How can I create a reclassified raster from another raster with
continuous values where the classification follows the following rules
* equal steps (a class break every 100 or 50 [mg/m^2])
* equal interval

Those two are equivalent. And can be done with a little r.mapcalc math or with r.recode rules (which you can embed in a script if you need to calculate the intervals on the fly.

* automatically classification based on defined number of classes

You can use r.quantile for quantile classification:

r.quantile elevation quantiles=5 -r --quiet | r.recode elevation out=elev_quant5 rules=-

Other methodes are currently not available AFAIK. Code exists (lib/arraystats) to calculate classifications according to different algorithms based on arrays of numbers. This is used for v.class and d.thematic.area, but I don't know how feasible it would be to use it for raster as the array of numbers to be classified is loaded into memory.

Moritz

Those two are equivalent. And can be done with a little r.mapcalc math
or with r.recode rules (which you can embed in a script if you need to
calculate the intervals on the fly.

What is the reason for not having this implemented in GRASS directly?
Design considerations?

I am looking for raster classification in equvalents to
* Equal Interval
* Quantile (OK, see below)
* Natural Breaks (Jenks)
* Standard Deviation
* Pretty Breaks

Note: OSGEO4W does not install R.

> * automatically classification based on defined number of classes

You can use r.quantile for quantile classification:

r.quantile elevation quantiles=5 -r --quiet | r.recode elevation
out=elev_quant5 rules=-

How do I get "|" pipe in the GUI on OSGEO4W?

I got a strange output using the example from the handbook:

r.quantile -r --q input=RASTER_fullrange percentiles=0.2,0.4,0.6,0.8
900.000000:900.000000:1
900.000000:900.000000:2
900.000000:900.000000:3
900.000000:900.000000:4
900.000000:2000.000000:5

What is wrong here?

And when I use the quanitles I get anther strange:

r.quantile -r --quiet input=RASTER_fullrange quantiles=4
1120.000000:1120.000000:1
2120.000000:1340.000000:2
1340.000000:1560.000000:3
1560.000000:2000.000000:4

-> Why does ot not set class 1 to
900.000000:1120.000000:1

900 is the minimum value.

Thanks a lot in advance,
Timmie