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

Hamish hamish_nospam at yahoo.com
Tue Oct 25 20:21:56 EDT 2005


> > 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.
> 
> I would have thought it easier to do:
> 
> 	r.mapcalc <<EOF
> 	  out.r = if(isnull(top),r#bottom,r#top)
> 	  out.g = if(isnull(top),g#bottom,g#top)
> 	  out.b = if(isnull(top),b#bottom,b#top)
> 	EOF


Indeed, much less circuitous. Multiband though so would need to run
r.composite first or:

r.mapcalc <<EOF
   out.r = if(isnull(land_mask), r#sea.r, r#land.r)
   out.g = if(isnull(land_mask), g#sea.g, g#land.g)
   out.b = if(isnull(land_mask), b#sea.b, b#land.b)
EOF


thanks for the tip,
Hamish




More information about the grass-dev mailing list