[GRASS-dev] in trunk png/cairo d.vect overwrites previous images?

Hello,

I ask here first before because this seems a bit weird that nobody else
reported it, but maybe I missed a bug report or something changed in grass
7?

When doing more than one d.vect after a d.mon start=png (or cairo) the
last one overwrite completly the previous one. With wx0 or 6.4 the
vector was on top but did not remove the previous vector.

Should I report that or is it known?

--
Pat

On 31/01/12 00:20, Patrice Dumas wrote:

Hello,

I ask here first before because this seems a bit weird that nobody else
reported it, but maybe I missed a bug report or something changed in grass
7?

When doing more than one d.vect after a d.mon start=png (or cairo) the
last one overwrite completly the previous one. With wx0 or 6.4 the
vector was on top but did not remove the previous vector.

Should I report that or is it known?

This behaviour is controlled by the GRASS_PNG_READ environment variable. If you set it to TRUE, then GRASS will lay the new d.vect on top of the already drawn vectors, otherwise it overwrites with the new. See http://grass.osgeo.org/grass70/manuals/html70_user/cairodriver.html.

Moritz

On Tue, Jan 31, 2012 at 10:36:01AM +0100, Moritz Lennert wrote:

This behaviour is controlled by the GRASS_PNG_READ environment variable.
If you set it to TRUE, then GRASS will lay the new d.vect on top of the
already drawn vectors, otherwise it overwrites with the new. See
http://grass.osgeo.org/grass70/manuals/html70_user/cairodriver.html.

Thanks. I was pretty sure I missed something although I did read the
Fine Manual before asking... Maybe the GRASS_PNG_READ description
could be enhanced by adding

  Otherwise the GRASS_PNGFILE file content is overwritten each time
  a new display command is used.

Also I think that the Example should also set

  export GRASS_PNG_READ=TRUE

otherwise it doesn't really make sense as the elevation raster will not
appear on map.png.

--
Pat

On 31/01/12 11:01, Patrice Dumas wrote:

On Tue, Jan 31, 2012 at 10:36:01AM +0100, Moritz Lennert wrote:

This behaviour is controlled by the GRASS_PNG_READ environment variable.
If you set it to TRUE, then GRASS will lay the new d.vect on top of the
already drawn vectors, otherwise it overwrites with the new. See
http://grass.osgeo.org/grass70/manuals/html70_user/cairodriver.html.

Thanks. I was pretty sure I missed something although I did read the
Fine Manual before asking... Maybe the GRASS_PNG_READ description
could be enhanced by adding

   Otherwise the GRASS_PNGFILE file content is overwritten each time
   a new display command is used.

Will do, thanks for the suggestion.

Also I think that the Example should also set

   export GRASS_PNG_READ=TRUE

otherwise it doesn't really make sense as the elevation raster will not
appear on map.png.

Here's what I see as example on the page:

export GRASS_RENDER_IMMEDIATE=cairo
export GRASS_PNGFILE=nc_spm.png
export GRASS_WIDTH=800
export GRASS_HEIGHT=800
export GRASS_PNG_READ=TRUE

g.region rast=elevation
d.rast map=elevation
d.vect map=streams width=1 color=blue fcolor=aqua type=area,line
d.vect map=roadsmajor width=2

i.e. GRASS_PNG_READ is set... :slight_smile:

Moritz

On Tue, Jan 31, 2012 at 11:15:47AM +0100, Moritz Lennert wrote:

>otherwise it doesn't really make sense as the elevation raster will not
>appear on map.png.

Here's what I see as example on the page:

export GRASS_RENDER_IMMEDIATE=cairo
export GRASS_PNGFILE=nc_spm.png
export GRASS_WIDTH=800
export GRASS_HEIGHT=800
export GRASS_PNG_READ=TRUE

g.region rast=elevation
d.rast map=elevation
d.vect map=streams width=1 color=blue fcolor=aqua type=area,line
d.vect map=roadsmajor width=2

i.e. GRASS_PNG_READ is set... :slight_smile:

Ah, ok, I was looking at
http://grass.osgeo.org/grass70/manuals/html70_user/pngdriver.html
There it is not set.

--
Pat