[GRASS-dev] ps.map: raster always under vector map?

Markus Neteler neteler at itc.it
Sat May 5 10:29:00 EDT 2007


On Wed, May 02, 2007 at 01:51:58PM +0100, Glynn Clements wrote:
> Markus Neteler wrote:
> 
> > > > >>> Bear in mind that the raster map is always opaque, so it will obscure
> > > > >>> anything which is drawn beneath it.
> > > > >>>       
> > > > >> Markus:
> > > > >>     
> > > > >>> That's exactly what I need: in my case the raster map contains a few
> > > > >>> cells only, but I need it on top to not be covered by vector contour
> > > > >>> lines etc.
> > > > >>>       
> > > > >> ..
> > > > >>     
> > > > >>> Maybe ps.map's raster command needs an additional parameter "ontop" or
> > > > >>> something like this? Hacking C code as Hamish suggests might be asked
> > > > >>> too much for the average user.
> > > > >>>       
> > > > >> are the null areas solid white, not transparent?
> > > > >>     
> > > > >
> > > > > They are transparent. All fine.
> > > > Of course I was too hasty. Nothing fine.
> > > > > Just that the tons of contour
> > > > > lines cover the scarse raster areas in the raster maps. That's
> > > > > why I need them on top of the dense contour lines.
> > > > >   
> > > > ... and it seems that NULL is not respected by ps.map (as you will know
> > > > already).
> > > 
> > > For masked images, you need to use the one-operand form of the "image"
> > > operator with an image dictionary; see the RASTERMASK procedure in
> > > lib/psdriver/psdriver.ps for an example. This requires support for
> > > level 3 PostScript (present in GhostScript for a few years now; I
> > > don't know about printers).
> > > 
> > > Regarding the generation of the image data (ps/ps.map/ps_raster.c), a
> > > masked image needs 2 (mono) or 4 (RGB) components, with the mask byte
> > > first (i.e. AARRGGBB); see lib/psdriver/Raster.c.
> > 
> > I am afraid that I am not able to implement this.
> 
> Try the attached patch.
> 
> It only works with single rasters, not R/G/B groups. Also, the masked
> flag is currently hard-coded on; ultimately, this would need to be
> made into an option to the raster/rgb/group commands.

Glynn,

do you consider to submit it? It seems to work well.

Thanks
Markus




More information about the grass-dev mailing list