[GRASS-user] How to set layer opacity in maps created from command line?

Gregory Penn gregory.penn at gmail.com
Thu Oct 3 10:44:38 PDT 2013


I am attempting to create maps from the command line, which are composites of several raster and vector layers. In order to visualize the data effectively, I need to vary the opacity of the layers. I have found that this is simple to achieve in the wxGUI, but the GUI does not display the underlying module call as it does with many other commands. A little Googling helped me to discover a module called g.pnmcomp, which was apparently used by the old Tcl/Tk GUI for managing layer opacity, but that module appears not to be intended for end users and I suspect that there is an easier and more direct way to achieve my desired results.

The process by which I'm creating my maps is essentially this sequence of commands (is there a better approach?):

g.region rast=region_raster.tif
d.mon start=PNG
d.rast map=some_raster.tif
d.rast map=another_raster.tif
d.vect map=some_vector.shp
d.mon stop=PNG

It seems to me that either d.mon or the PNG driver is doing the compositing and so would handle the opacity of the layers, but I can't find any documentation of how to specify values for opacity. This is surprising to me because it seems that what I'm trying to do is such a basic and commonly used operation in creating maps. What am I missing?


More information about the grass-user mailing list