<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Thanks Vinay, for the suggestion but I get an error on the
d.out.file instruction.<br>
By the way, I've investigated the problem a bit further and found
that I mixed up instructions from manuals of different versions.<br>
So coming back to GRASS v 7.0.x references I finally succeed in
obtaining a solution but not 100% satisfactory.<br>
<br>
First trial create a unique image combining raster and vector, but
width and height remains at default and background is not
transparent:<br>
<br>
os.environ['GRASS_RENDER_TRANSPARENT'] = 'TRUE'<br>
os.environ['GRASS_RENDER_WIDTH'] = str(1280)<br>
os.environ['GRASS_RENDER_HEIGHT'] = str(960)<br>
os.environ['GRASS_RENDER_FILE'] = filenameCombined.png<br>
<br>
self.gscript.run_command('d.mon', overwrite=True, start='png',
output=filename)<br>
self.gscript.run_command('d.rast', map='{0}@{1}'.format(raster,
currentmapset)<br>
self.gscript.run_command('d.vect', map='{0}@{1}'.format(map,
currentmapset), color='white', fill_color='none') <br>
self.gscript.run_command('d.mon', stop="png")<br>
<br>
<br>
Second trial successfull for obtaining desired width, height and
transparency of the background but creating 2 images one for the
raster and the other for the vector, now I would like to combine
them to have only one image:<br>
<br>
os.environ['GRASS_RENDER_IMMEDIATE'] = 'png'<br>
os.environ['GRASS_RENDER_TRANSPARENT'] = 'TRUE'<br>
os.environ['GRASS_RENDER_WIDTH'] = str(1280)<br>
os.environ['GRASS_RENDER_HEIGHT'] = str(960)<br>
<br>
os.environ['GRASS_RENDER_FILE'] =
filenameOfRaster.png <br>
self.gscript.run_command('d.rast', map='{0}@{1}'.format(raster,
currentmapset))<br>
<br>
os.environ['GRASS_RENDER_FILE'] = filenameOfVector.png<br>
self.gscript.run_command('d.vect', map='{0}@{1}'.format(map,
currentmapset), color='white', fill_color='none')<br>
<br>
Modifying this with the following<br>
<br>
os.environ['GRASS_RENDER_FILE'] = filenameCombined.png
<br>
self.gscript.run_command('d.rast', map='{0}@{1}'.format(raster,
currentmapset))<br>
self.gscript.run_command('d.vect', map='{0}@{1}'.format(map,
currentmapset), color='white', fill_color='none')<br>
<br>
ends with only the image of the vector.<br>
<br>
I've the feeling that using d.mon would be preferable, but it seems
that it does not take into account the environment variables (at the
exception of GRASS_RENDER_FILE) that I propose.<br>
<br>
If you have other suggestions to go further I'll be very gratefull.<br>
Ciao<br>
<br>
<pre class="moz-signature" cols="72">--
Jean Pierre Huart
</pre>
<br>
<br>
<div class="moz-cite-prefix">On 09/03/16 05:10, Vinay Elothunkal
wrote:<br>
</div>
<blockquote
cite="mid:CAEke+YGPynJt+NZYW_tAUk513HqXZf7u+Krz+_ApeXzvxpAb=Q@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><span style="font-size:12.8000001907349px">Hi </span><span
style="font-size:12.8000001907349px">jean pierre huart,</span><br>
</div>
<div style="font-size:12.8000001907349px"><span
style="font-size:12.8000001907349px"><br>
</span></div>
<div style="font-size:12.8000001907349px"><span
style="font-size:12.8000001907349px">I have exported png
image using module "d.out.file",(I have pasted a part of the
script below which I have used. I hope this will help
you....</span></div>
<div style="font-size:12.8000001907349px"><span
style="font-size:12.8000001907349px">.......................................................</span></div>
<div style="font-size:12.8000001907349px">
<div><span style="font-size:12.8000001907349px">import
grass.script as g</span></div>
<div><span style="font-size:12.8000001907349px">import os</span></div>
<div><span style="font-size:12.8000001907349px">import shutil</span></div>
<div><span style="font-size:12.8000001907349px">import time</span></div>
</div>
<div style="font-size:12.8000001907349px">
<div><span style="font-size:12.8000001907349px">g.run_command('r.colors',map=str(i),rules='color_table.txt')</span></div>
<div><span style="font-size:12.8000001907349px">
g.start_command('d.mon', start='wx1')</span></div>
<div><span style="font-size:12.8000001907349px">
time.sleep(10)</span></div>
<div><span style="font-size:12.8000001907349px">
g.run_command('d.rast', map=str(i))</span></div>
<div><span style="font-size:12.8000001907349px">
time.sleep(10)</span></div>
<div><span style="font-size:12.8000001907349px">
g.run_command('d.vect', map=str(i))</span></div>
<div><span style="font-size:12.8000001907349px">
time.sleep(40)</span></div>
<div><span style="font-size:12.8000001907349px">
g.run_command('d.out.file',output=str(i),format='png',size=(2403,2403))</span></div>
<div><span style="font-size:12.8000001907349px">
time.sleep(10)</span></div>
<div><span style="font-size:12.8000001907349px">
g.run_command('d.mon', stop='wx1')</span></div>
<div><span style="font-size:12.8000001907349px">
time.sleep(10)</span></div>
<div style="font-size:12.8000001907349px">.................................................................</div>
</div>
<div style="font-size:12.8000001907349px"><br>
</div>
<div style="font-size:12.8000001907349px">Regards,</div>
<div style="font-size:12.8000001907349px">Vinay</div>
<div class="gmail_extra"></div>
</div>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>