[GRASSLIST:5227] Floating point data

Miha STAUT mihastaut at hotmail.com
Sat Dec 14 06:47:01 EST 2002


I noticed that many of the commands reduce raster data to only 255 category 
values, at least r.info says so (e.g. r.average). Is it because of the 
floating point  (like the following mail) representation or is it something 
else (e.g. like r.stats)?
Miha Staut

Ben Logan wrote:

>I have some DEMs with 30 meter resolution, and the elevation values
>appear to be in feet instead of meters like the 10 meter res DEMs.  It
>looked like I could convert the feet to meters with r.mapcalc, so I
>ran it with
>as the expression.  It suceeded, but r.info says that my new map
>(elev) only has 255 categories.  The original (elev30) had 2441.  It
>seems to me that I should have the same number of categories...am I
>missing something?

In the above case, r.mapcalc will produce a floating-point map.

Floating-point maps don't really have categories. The values can be
coerced into categories using the map's quantisation rules, but only a
few programs (e.g. r.stats) do this. Most programs just use the exact
floating-point value.

The quantisation rules can be changed with r.quant.

Also, you can force r.mapcalc to generate an integer map using the
"int(...)" operator, i.e.

	r.mapcalc 'elev=int(elev30/3.28)'

I would expect that to have ~745 categories (one for each metre of the
range, rather than one per foot).

Glynn Clements <glynn.clements at virgin.net>

Add photos to your e-mail with MSN 8. Get 2 months FREE*. 

More information about the grass-user mailing list