[GRASS5] [bug #3011] (grass) d.mon CELL doesn't work

Hamish hamish_nospam at yahoo.com
Tue Oct 25 01:56:22 EDT 2005


On Sun, 24 Jul 2005 20:54:13 +0100 (BST)
Paul Kelly <paul-grass at stjohnspoint.co.uk> wrote:

> > Because we are talking here about substituting the CELL driver 
> > functionality. And as I understand it, CELL driver is for obtaining
> > a  Grass layer out of the monitor content (not a particular layer,
> > like  r.out.gdal, or a fragment of layer currently displayed, like
> > r.out.tiff -t) with a colortable stored.
> 
> The only thing I can think that would be useful for was before there
> were  direct monitor output methods like the PNG driver, you could
> write the  monitor to a GRASS raster layer and then use r.out.tiff or
> whatever to get it into an output file.
..
> But I can't think of a reason why you would want a monitor image as a 
> GRASS raster; rather I would put it that it is the CELL driver that 
> requires two images to get to an output graphics file.
..
> It makes it easy to convert a monitor image into a GRASS raster, but
> what  use is it once you've got it there? I feel it is an historical 
> anachronism.


for the record, an example and work around for this situation.

ps.map will only take one raster for an input image. recently I wanted
to create a hard copy which overlayed one raster image over another
(land+sea satellite images butted up against each other using NULLs).
Each raster had its own unreconcilable color table so I couldn't use
r.patch, and using both the 'rgb' and 'raster' ps.map commands still
would only let me show one raster.

The solution was to set GRASS_WIDTH and GRASS_HEIGHT to the rows &
columns given by g.region, use the PNG driver to dump to a 24-bit image,
reload that rather large image with r.in.gdal, reset the imported maps'
bounds with r.region (trivial as it matched the originial region), then
use d.rgb and ps.map's "rgb" command to display the whole thing. Having
a CELL driver might have made it slightly easier, but more obscure to
use and not useful enough to justify maintaining the code IMO.


Hamish




More information about the grass-dev mailing list