[GRASS-user] r.reclass probs with negative values
Michael Barton
michael.barton at asu.edu
Tue Nov 14 23:12:31 EST 2006
R.mapcalc and r.recode both create new maps.
However, r.reclass is especially useful because it DOESN'T create a new map.
It just makes a new cats table for an existing raster map. This means that
it is sort of a 'virtual' map or map 'view'. It also means that it runs much
faster (important in interated scripts) and takes up very little space (also
good for iteration that creates multiple map 'views').
It would be nice if this could be done with FP maps too somehow, since FP
maps also have cats tables that affect how they are displayed.
Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton
> From: Hamish <hamish_nospam at yahoo.com>
> Date: Wed, 15 Nov 2006 11:45:18 +1300
> To: <malte at perlomat.de>
> Cc: <grassuser at grass.itc.it>
> Subject: Re: [GRASS-user] r.reclass probs with negative values
>
> Malte Halbey-Martin wrote:
>>> certainly something total easy, but is there a way to reclassify
>>> negative values with r.reclass?
>>>
>>> fp: Data range is -0.2180119007825851440429688 to
>>> 0.1608885973691940307617188
>>>> -0.2180119007825851440429688 thru 0.001 = 1 label
>>> -0.718012 rounded up to 0
>>> 0.501000 rounded up to 0
>>>
>>> Does r.reclass only work with integer or positive values? I couldn't
>>> find anything about that in the manual.
>
> Glynn:
>> Only integer maps can be reclassed.
>
>
> for FP reclassification use r.mapcalc:
>
> r.mapcalc "newmap= if( oldmap < 0.001, 1, 2 )"
>
> if( test, then this, otherwise this )
>
>
> Hamish
>
>
More information about the grass-user
mailing list