[GRASS-dev] Re: added opacity option to grc file

Glynn Clements glynn at gclements.plus.com
Mon Sep 11 19:35:44 EDT 2006


Michael Barton wrote:

> Now that I finally got thematic mapping working on my Mac again, I was able
> to look into this.
> 
> I think switching to immediate mode rendering has broken thematic mapping
> from the GUI. Looking at it, I'm not sure why it was working before.
> 
> I'm pretty sure that what is happening is that the thematic mapping script
> is iteratively running d.vect (actually this IS what is happening). Somehow,
> this was getting written to a single output PPM that was then composited and
> displayed with any other map in the layer tree. Perhaps this was happening
> because of the lag in writing the output PPM allowed all the iterated d.vect
> writes in the display driver to put it all together before it was output to
> a file.
> 
> With immediate mode rendering, the PPM output is considerably faster. So
> d.vect.thematic is repeatedly writing it's vector displays (one for each
> theme) to a file directly, rather than to the display driver and then to a
> file. The unfortunate result is that it is writing each theme to the SAME
> file, overwriting any previous theme. So you only see the last theme
> written.
> 
> At the moment, I can't think of a clever way to fix this so that the script
> works as a stand alone module and can write in  the old way to the display
> driver, and at the same time work in the GUI environment. I'm loathe to
> rewrite the whole thing in TclTk and then have to maintain 2 versions.
> 
> Any suggestions are welcome. Glynn???

It has nothing to do with speed.

If you use a monitor, each rendering operation is performed on top of
what is already on the "screen" (i.e. the image, for the PNG driver). 
The screen is only cleared if you use d.erase or similar.

With direct rendering, each d.* command is self-contained, and starts
with a blank image (filled with $GRASS_BACKGROUNDCOLOR, or transparent
if $GRASS_TRANSPARENT == TRUE). The behaviour is equivalent to
starting the monitor before running each command and stopping it
afterwards.

If you want a single image which contains the output from multiple d.*
commands, either use a monitor, or rename the image file after each
operation then composite them with g.pnmcomp.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list