[GRASS5] Re: d.his r.his question

Glynn Clements glynn.clements at virgin.net
Wed Dec 12 10:04:19 EST 2001

Markus Neteler wrote:

> > I am actaully writing with a question about d.his (and r.his). In the
> > past I used a modified version of d.his to create color shaded relief
> > maps. In other words I fused a color raster (h_map) with a grey
> > sun-illuminated raster (i_map).  The new r.his seems to be (correctly)
> > designed for imagery.

Treating colour images as a single raster layer with R*G*B distinct
categories is something of a kludge. In the absence of vector-valued
cell maps (i.e. band-interleaved-by-pixel), the next best thing (IMHO)
is separate R,G,B maps (effectively band-sequential).

I'm having second thoughts about whether r.his and r.composite should
have separate arguments for each channel, though. It might be better
to just have input=/output= and require that the bands are called
foo.r, foo.g and foo.b.

> yes, d.his and r.his I also use for this purpose. Don't you like the
> result?
> > The question I have is there another program that I have overlooked for
> > combining a color classified raster with a grey shaded raster to create
> > a single fused raster? 
> For this r.composite is nice. However, due to the speed limitations
> in the current GRASS color model, you may avoid to use more than 8000
> colors.
> BTW: Does anyone know the reason for the color limitations? We
> shall put this into the bugtracker. I can't recall the reason.

Partly memory consumption (for the colour table), but mainly speed. 
Adding a new colour rule (with e.g. G_add_c_raster_color_rule())
checks for overlaps against each of the existing colour rules. As the
number of existing rules increases, the time taken to add each new
rule increases.

Intuition suggests that the time complexity should be O(n^2), but
quick tests suggests that it may even be O(n^3). Try running
r.composite with different values for the "levels=" option. If you try
with "levels=256", you'll see why this isn't the default ;)

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-dev mailing list