[GRASSLIST:2134] Re: r.reclass: how to reclass only part of the categories

Eric G. Miller egm2 at jps.net
Fri Jul 20 06:52:59 EDT 2001

On Fri, Jul 20, 2001 at 12:19:04PM +0200, mlennert at club.worldonline.be wrote:
> Hello,
> I've downloaded some GLOBE DEM files, and I would like to use them in nviz. 
> The problem is that some areas (such as the polders in Holland) have values 
> around 65500, making it difficult to use the files in nviz due to the extreme 
> differences in values. I would therefore like to reclass them in order to give 
> them all a value of -1.
> Now r.reclass allows me to either use reclass rules, but then I would have to 
> write a reclass rule for evey point between 0 and 9000 (the ones I want to 
> keep the way they are) since if I don't do it, r.reclass will class them all 
> as NULL. And if I use the r.reclass interface, I would have to do all the 
> changes to -1 by hand.
> So my question: is there a reclass rule meaning something like 'leave 1 thru 
> 9000 the way they are' ?
> Or: is there a way to tell nviz to not take into accont z values outside of a 
> defined range ?

I think r.reclass is really designed with categorical data in mind (or
as an end result).  While it would certainly take more disk space, you
could do what you want with r.mapcalc  -- "out = if(in > 9000, -1, in)".
Alternatively, you might consider r.resample.  Also, I think it's worth
noting that there might be a little bit of a performance penalty when
the number of reclass rules gets very large.  

Eric G. Miller <egm2 at jps.net>

More information about the grass-user mailing list