[GRASS-dev] r.colors now producing bogus color files for 'ryg'
case
Hamish
hamish_nospam at yahoo.com
Thu May 31 03:13:29 EDT 2007
Hamish:
> > I notice that the range of the DCELL map is greater than the range
> > of its color map, so max values will be shown as the null value
> > color (nv white). Something cast to int when it should use ceil(max)
> > and floor(min)? How does that work if the data range is 0.0-1.0?
Dylan:
> Thanks for the follow-up Hamish. I am rather mystified by this problem
> myself as the rules file in '/usr/local/grass-xxx/etc/color/ryg'
> looks fine. The dataset that caused this mess ranges from 0.1 - 0.6.
> Other other color ramps appear to work fine. The resultant colr file
> had something like
>
> 0%
> 0:127:0 0:127:0
>
> in it.. I can check again if that looks like it might mean something.
and that's the full file!
ah, FP range from 0.1 - 0.6 may be a clue.
I can reproduce this now,
G63> r.mapcalc test="rand(0.1,0.6)"
G63> d.rast test
# looks ok, no colr file so default rainbow colors noise
G63> r.colors test col=rainbow
G63> d.redraw
# blank!
G63> cat colr/test
% 0 0
0:255:0:127 0:255:0:127
range is 0->0, so all color is outside of data.
The default null color rule is "nv white".
color=byr should look like:
% 0.100000000000019545476348525881 0.599997845421177067315454678464
0.100000000000019545476348525881:0:0:255 0.3499989227:255:255:0
0.3499989227:255:255:0 0.599997845421177067315454678464:255:0:0
So FP maps are being treated as CELL maps?
Setting with r.colors -i rules works ok:
the bug is only in 6.3-cvs, 6.2.x is ok.
Hamish
More information about the grass-dev
mailing list