[GRASS-user] Adding a semi-transparent layer

Dear list,

on the map display of the GRASS gui is very easy to get a transparency
effect on a layer, but I have been trying to do it exclusively by command
line to script a task and I didn’t success. Does anyone know how can I solve
this issue? The aim is to add a semi-transparent layer with climatological
information above a terrain raster.

Thanks in advance,

José A. Ruiz

José Antonio Ruiz Arias wrote:

on the map display of the GRASS gui is very easy to get a transparency
effect on a layer, but I have been trying to do it exclusively by command
line to script a task and I didn’t success. Does anyone know how can I solve
this issue? The aim is to add a semi-transparent layer with climatological
information above a terrain raster.

If you want the end result as an image, you can use the same mechanism
as gis.m uses, i.e. generate each layer as a PPM/PGM pair using the
PNG driver then combine them with g.pnmcomp.

If you need the result as a map, so that you can use it as a
background in an X monitor, use r.blend.

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

José Antonio Ruiz Arias wrote:

on the map display of the GRASS gui is very easy to get a transparency
effect on a layer, but I have been trying to do it exclusively by
command line to script a task and I didn't success. Does anyone know
how can I solve this issue? The aim is to add a semi-transparent layer
with climatological information above a terrain raster.

see the d.shadedmap script in gui/tcltk/gis.m/script/

which calls this:

  d.his "h_map=$GIS_OPT_DRAPEMAP" "i_map=$GIS_OPT_RELIEFMAP"

Hamish

You must render your maps out to *.PPM files with *.PPG mask files. Then you
can composite them with g.pnncomp. You can look in mapdisp.tcl to get an
idea of how to do it.

Michael

On 3/21/07 1:54 PM, "José Antonio Ruiz Arias" <jararias@ujaen.es> wrote:

Dear list,

on the map display of the GRASS gui is very easy to get a transparency
effect on a layer, but I have been trying to do it exclusively by command
line to script a task and I didn¹t success. Does anyone know how can I solve
this issue? The aim is to add a semi-transparent layer with climatological
information above a terrain raster.

Thanks in advance,

José A. Ruiz

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Just note, which does not help you yet:

this should be a feature of the new wx gui..

jachym

2007/3/21, José Antonio Ruiz Arias <jararias@ujaen.es>:

Dear list,

on the map display of the GRASS gui is very easy to get a transparency
effect on a layer, but I have been trying to do it exclusively by command
line to script a task and I didn't success. Does anyone know how can I solve
this issue? The aim is to add a semi-transparent layer with climatological
information above a terrain raster.

Thanks in advance,

José A. Ruiz

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

--
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub

I've been trying to create the PPM/PGM pair with the PNG driver. Using the next commands I get the ppm file:

export GRASS_TRUECOLOR="TRUE"
export GRASS_WIDTH=642
export GRASS_WIDTH=371
export GRASS_PNGFILE=mde.ppm

d.mon start=PNG
d.mon select=PNG
d.rast map=mde
d.mon stop=PNG

But doing the same for the pgm file I get an error message. I have looked for some specific command in GRASS to create de pgm but I haven't found it. Also looked for the mapdisp.tcl to take it a look but I don't have it in my system (at least that's what I think). So I finally used the convert tool (ImageMagic utility) to generate the pgm from the ppm and then I composited with g.pnmcomp, but the result is not as nice as using GRASS.

So, any shortcut to solve the problem inside GRASS?

Thanks in advance

-----Mensaje original-----
De: Glynn Clements [mailto:glynn@gclements.plus.com]
Enviado el: miércoles, 21 de marzo de 2007 23:44
Para: José Antonio Ruiz Arias
CC: grassuser@grass.itc.it
Asunto: Re: [GRASS-user] Adding a semi-transparent layer

Jos・Antonio Ruiz Arias wrote:

> on the map display of the GRASS gui is very easy to get a transparency
> effect on a layer, but I have been trying to do it exclusively by
command
> line to script a task and I didn稚 success. Does anyone know how can I
solve
> this issue? The aim is to add a semi-transparent layer with
climatological
> information above a terrain raster.

If you want the end result as an image, you can use the same mechanism
as gis.m uses, i.e. generate each layer as a PPM/PGM pair using the
PNG driver then combine them with g.pnmcomp.

If you need the result as a map, so that you can use it as a
background in an X monitor, use r.blend.

--
Glynn Clements <glynn@gclements.plus.com>
__________ Informaci

José Antonio Ruiz Arias wrote:

I've been trying to create the PPM/PGM pair with the PNG driver. Using the next commands I get the ppm file:

export GRASS_TRUECOLOR="TRUE"
export GRASS_WIDTH=642
export GRASS_WIDTH=371
export GRASS_PNGFILE=mde.ppm

d.mon start=PNG
d.mon select=PNG
d.rast map=mde
d.mon stop=PNG

But doing the same for the pgm file I get an error message. I have
looked for some specific command in GRASS to create de pgm but I
haven't found it.

Add:
  export GRASS_TRANSPARENT=TRUE

This will cause a PGM file to be written out in addition to the PPM
file. The PGM file contains the mask.

Also looked for the mapdisp.tcl to take it a look
but I don't have it in my system (at least that's what I think).

The file which performs the compositing is etc/gm/mapcanvas.tcl.

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

Seems to work fine. Thanks a lot Glynn. :wink:

________________________________

José A. Ruiz Arias
Departamento de Física
Escuela Politécnica Superior
Edificio A-3, Campus Lagunillas
Universidad de Jaén
23071 Jaén Spain
Tlf. +34 953212474
Email: jararias@ujaen.es
_____________________________________

-----Mensaje original-----
De: Glynn Clements [mailto:glynn@gclements.plus.com]
Enviado el: jueves, 22 de marzo de 2007 15:19
Para: José Antonio Ruiz Arias
CC: grassuser@grass.itc.it
Asunto: RE: [GRASS-user] Adding a semi-transparent layer

José Antonio Ruiz Arias wrote:

> I've been trying to create the PPM/PGM pair with the PNG driver. Using
the next commands I get the ppm file:
>
> export GRASS_TRUECOLOR="TRUE"
> export GRASS_WIDTH=642
> export GRASS_WIDTH=371
> export GRASS_PNGFILE=mde.ppm
>
> d.mon start=PNG
> d.mon select=PNG
> d.rast map=mde
> d.mon stop=PNG
>
>
> But doing the same for the pgm file I get an error message. I have
> looked for some specific command in GRASS to create de pgm but I
> haven't found it.

Add:
  export GRASS_TRANSPARENT=TRUE

This will cause a PGM file to be written out in addition to the PPM
file. The PGM file contains the mask.

> Also looked for the mapdisp.tcl to take it a look
> but I don't have it in my system (at least that's what I think).

The file which performs the compositing is etc/gm/mapcanvas.tcl.

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

__________ Información de NOD32 2134 (20070322) __________

Este mensaje ha sido analizado con NOD32 antivirus system
http://www.nod32.com