[GRASS5] The status of 5.0

Markus Neteler neteler at itc.it
Wed Mar 27 16:59:13 EST 2002


On Wed, Mar 27, 2002 at 05:57:25PM +0000, Glynn Clements wrote:
> 
> Markus Neteler wrote:
> 
> > > Also, reclass.c has specific code (re_reclass()) to generate a reclass
> > > of reclass. However, main.c explicitly checks for this case and
> > > generates a fatal error if you try to use it. This limitation wasn't
> > > in 4.3; it was introduced in:
> > > 
> > > 	revision 1.3
> > > 	date: 2001/02/07 10:33:07;  author: markus;  state: Exp;  lines: +8 -0
> > > 	added check if input map is already a reclass (currently not allowed)
> > > 
> > > Markus: do you recall the reasoning behind this?
> > 
> > Well, that time the "reclass of reclass" didn't seem to work. If yes,
> > the check should definitly be removed to enable again reclasses of reclass.
> 
> While looking into this, I encountered what appears to be incorrect
> behaviour regarding the handling of categories when using a
> default-to-self rule (this applies to reclassing non-reclass maps):
> 
> 	GRASS:~ > r.reclass in=soils out=foo           
> 	
> 	Enter the rule or 'help' for the format description:
> 	> 2=1 cat1
> 	> 4=2 cat2
> 	> *=*
> 	> end
> 	GRASS:~ > r.cats foo | head
> 	Reading foo in glynn ... 100%
> 	1       Aab
> 	2       cat2
> 	3       Bb
> 	5       BcC
> 	6       BeE
> 	7       Bhe
> 	8       Bkd
> 	9       CBE
> 	10      CaD
> 	11      CaE
> 	GRASS:~ > 
> 
> Category #1 retains its old label, even though it appears on the RHS
> of a rule. Basically, category labels are retained when the category
> doesn't appear on the LHS; I would have thought that it should be the
> RHS which is checked.
> 
> Can someone confirm that this is a bug?

Glynn,

I have done a quick test:

r.report realnutz96
[...]
|-----------------------------------------------------------------------------|
|2100|Laubforste
|2200|Mischforste
|2300|Nadelforste
|3000|Kleingehoelze sowie Einzelbaeume und Straeucher
|6000|Ruderal-, Uferstauden und Schlagfluren, Saeume
|7000|Gruenland (allgemein)
|7100|Wirtschaftsgruenland
|7110|Wiesen
[...]


r.reclass realnutz96 out=recl

Enter the rule or 'help' for the format description:
> 2100=1 cat1
> 6000=2 cat2
> *=*      
> end

r.report recl
|-----------------------------------------------------------------------------|
|   1|cat1
|   2|cat2
|2200|
|2300|
|3000|
|   *|no data
+-------------------


not sure if this what we should expect...
Probably my test is bad as the IDs are not from 1..something.

Anyone else with a quick test?

 Markus



More information about the grass-dev mailing list