[GRASS5] d.his r.his question (smaller samples)
glynn.clements at virgin.net
Thu Dec 13 18:23:22 EST 2001
Bob Covill wrote:
> I have attached 3 smaller sections of the earlier files. Again the first
> image dem1.png is the the original color classified dem. The second
> image his1.png is the file created with the modified d.his. The third
> file, his2.png, was created from r.his->r.combine->r.out.ppm3.
OK; I've re-read the whole thread, and see what you're getting at. I
had been thinking that this was regarding something which used to work
with the original d.his before I changed it. Sorry for the confusion.
To get back to your actual question:
> I guess the question is, should r.his be only used for imagery (CELL)
> data or should it be expanded to include FCELL type data? Would it be
> better to come up with a new program to combine a hue map with a
> intensity map? Starting to sound like the same questions asked over.
I think that r.his should probably be expanded to handle FCELL/DCELL
data, as should d.his and r.composite.
Both of these programs operate on 8-bit unsigned integer values. I.e.
they read cell values, convert these to RGB colours, then operate upon
the colours. And both programs use CELL (integer) values for the
intermediate stage, which (as your image shows) loses information when
used on FP data with a relatively small range (i.e. where coercion to
integer introduces a large relative error).
Given that the problem exists in at least three programs, and maybe
more, it might be better to write a utility function to read the
CELL/FCELL/DCELL values and perform the colour lookups. That would
mean that programs which don't care about the actual values, but only
the associated colours, wouldn't each need to handle each of the
different data formats.
BTW, if you need a solution right now, it wouldn't be that hard to do
it with r.mapcalc; this is the approach taken by rgb.hsv.sh and
hsv.rgb.sh. Actually, I'm wondering if this wouldn't be a better
approach for r.his.
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev