<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body bgcolor="#FFFFFF" text="#333333">
<p>Stephan,</p>
<p>The G_OPT_OUTPUT option generate well the check box "add tree
layer" in my script GUI.</p>
<p>My problem, now is how to add the raster output while I want to
set his name by the script ? I succeed with g.copy my_raster_name
to output_raster_name. The copy is well displayed but this creates
a copy what is not very convenient...</p>
<p>Cheers,</p>
<p>Frank<br>
</p>
<div class="moz-cite-prefix">Le 24/10/2018 à 11:05, Stefan
Blumentrath a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:DB7PR02MB458585B7BB111A9D0F2BBF5D9EF60@DB7PR02MB4585.eurprd02.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US">Hi
Frank,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Using GRASS standard parser options is a good
practice. Unfortunately, it does not yet generate the
</span><span lang="EN-GB">"add to tree layer" check box in the
AddOn GUI (though I hope that can be added in core though).</span><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">You can use e.g.
</span><span lang="EN-GB">G_OPT_R_OUTPUT and still choose a
non-standard key-name for the option in your script with a
line like this:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">#% key:
my_option_key_name<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Stefan<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext"
lang="EN-US">From:</span></b><span
style="color:windowtext" lang="EN-US"> Frank David
<a class="moz-txt-link-rfc2396E" href="mailto:frank.david@geophom.fr"><frank.david@geophom.fr></a>
<br>
<b>Sent:</b> onsdag 24. oktober 2018 10:48<br>
<b>To:</b> Stefan Blumentrath
<a class="moz-txt-link-rfc2396E" href="mailto:Stefan.Blumentrath@nina.no"><Stefan.Blumentrath@nina.no></a>; Nikos Alexandris
<a class="moz-txt-link-rfc2396E" href="mailto:nik@nikosalexandris.net"><nik@nikosalexandris.net></a><br>
<b>Cc:</b> Laurent C. <a class="moz-txt-link-rfc2396E" href="mailto:lrntct@gmail.com"><lrntct@gmail.com></a>; GRASS
user list <a class="moz-txt-link-rfc2396E" href="mailto:grass-user@lists.osgeo.org"><grass-user@lists.osgeo.org></a>; GRASS
developers list (<a class="moz-txt-link-abbreviated" href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a>)
<a class="moz-txt-link-rfc2396E" href="mailto:grass-dev@lists.osgeo.org"><grass-dev@lists.osgeo.org></a><br>
<b>Subject:</b> Re: [GRASS-user] d.rast in python script<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Stephan,<o:p></o:p></p>
<p>Your last message makes me search after G_OPT_OUTPUT. I had
never realized that this option makes the "add to tree layer"
check box appear on the script GUI.<o:p></o:p></p>
<p>All my scripts create rasters without G_OPT_OUTPUT option
(because the name of output are handled by the script itself)
and so, without check box. Using d.rast could keep interesting
i think in order to select witch one should be display or not,
but for the moment I can (may be) overtake that limitation by
using the G_OPT_OUTPUT option (I will see).<o:p></o:p></p>
<p>Sorry for confusing. And thank you very much for your help. I
let you see if the ticket you had post is appropriate.<o:p></o:p></p>
<p>Cheers,<o:p></o:p></p>
<p>Frank<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">Le 24/10/2018 à 10:13, Stefan Blumentrath
a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Hi Frank,</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">My guess is that the GRASS standard parser
options [1] (e.g. G_OPT_R_OUTPUT, G_OPT_R_OUTPUTS,</span><span
lang="EN-GB">
</span><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">G_OPT_V_OUTPUT, …) would be used in order to
determine what has to be / could be added to the map
display…</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">But I am no GUI dev, and cannot tell for
sure, hope experts on that part of the code could chime in
…</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">And yes, I agree that a convenient function
in the Python library for adding a map in the currently
active layer manager would be a nice new feature (if it
does not exist and I just overlooked it)…</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Maybe another ticket?...</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Cheers</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Stefan</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">1:
<a
href="https://grass.osgeo.org/grass74/manuals/parser_standard_options.html"
moz-do-not-send="true">https://grass.osgeo.org/grass74/manuals/parser_standard_options.html</a></span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext"
lang="EN-US">From:</span></b><span
style="color:windowtext" lang="EN-US"> Frank David
<a href="mailto:frank.david@geophom.fr"
moz-do-not-send="true"><frank.david@geophom.fr></a>
<br>
<b>Sent:</b> onsdag 24. oktober 2018 09:35<br>
<b>To:</b> Stefan Blumentrath <a
href="mailto:Stefan.Blumentrath@nina.no"
moz-do-not-send="true"><Stefan.Blumentrath@nina.no></a>;
Nikos Alexandris
<a href="mailto:nik@nikosalexandris.net"
moz-do-not-send="true"><nik@nikosalexandris.net></a><br>
<b>Cc:</b> Laurent C. <a
href="mailto:lrntct@gmail.com"
moz-do-not-send="true"><lrntct@gmail.com></a>;
GRASS user list
<a href="mailto:grass-user@lists.osgeo.org"
moz-do-not-send="true"><grass-user@lists.osgeo.org></a>;
GRASS developers list (<a
href="mailto:grass-dev@lists.osgeo.org"
moz-do-not-send="true">grass-dev@lists.osgeo.org</a>)
<a href="mailto:grass-dev@lists.osgeo.org"
moz-do-not-send="true"><grass-dev@lists.osgeo.org></a><br>
<b>Subject:</b> Re: [GRASS-user] d.rast in python
script</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p>Hi Stephan,<o:p></o:p></p>
<p>Thank you for the ticket. One thing seems to me important.
Some (of my) scripts can generate numerous rasters and one
or two cumulative raster. I don't want to add base rasters
but only the few cumulative. If the script GUI have a check
box, how to make the choice between these I want to display
and those I don't want ?<o:p></o:p></p>
<p>For my point of view, the use of d.rast inside the script,
as we do for all other grass command, should be possible, in
order to display what we want to display.<o:p></o:p></p>
<p>Cheers,<o:p></o:p></p>
<p>Frank<o:p></o:p></p>
<div>
<p class="MsoNormal">Le 24/10/2018 à 09:23, Stefan
Blumentrath a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Hei Nikos, Frank,</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">I opened an enhancement ticket, and asked
to activate the "Add created map(s) into layer tree"
also for addons:</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"><a
href="https://trac.osgeo.org/grass/ticket/3686"
moz-do-not-send="true">https://trac.osgeo.org/grass/ticket/3686</a>.
No idea what changes this would require…</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Would that cover your needs, Frank, or do
you have a more interactive use in a python script in
mind?</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">You can start a wx monitor (d.mon wx0) and
add a map there, but I have not found a way to address
the currently active Map Display …</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">This would probably require additional
function(s) in the Python libraries…?</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Maybe this question is better asked at the
developer list (thus I put grass-dev in CC).</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Cheers</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">Stefan</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext"
lang="EN-US">From:</span></b><span
style="color:windowtext" lang="EN-US"> Frank David
<a href="mailto:frank.david@geophom.fr"
moz-do-not-send="true"><frank.david@geophom.fr></a>
<br>
<b>Sent:</b> onsdag 24. oktober 2018 08:26<br>
<b>To:</b> Nikos Alexandris <a
href="mailto:nik@nikosalexandris.net"
moz-do-not-send="true"><nik@nikosalexandris.net></a><br>
<b>Cc:</b> Stefan Blumentrath <a
href="mailto:Stefan.Blumentrath@nina.no"
moz-do-not-send="true"><Stefan.Blumentrath@nina.no></a>;
Laurent C.
<a href="mailto:lrntct@gmail.com"
moz-do-not-send="true"><lrntct@gmail.com></a>;
GRASS user list <a
href="mailto:grass-user@lists.osgeo.org"
moz-do-not-send="true">
<grass-user@lists.osgeo.org></a><br>
<b>Subject:</b> Re: [GRASS-user] d.rast in python
script</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">Le 23/10/2018 à 23:26, Nikos
Alexandris a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">* Frank David <a
href="mailto:frank.david@geophom.fr"
moz-do-not-send="true"><frank.david@geophom.fr></a>
[2018-10-23 22:06:01 +0200]:
<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Thank you everybody for your help.
Do you know why a run_command("d.rast"... in a python
script is not enough to display a raster ? I don't
understand why this command is so different.
<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
Display a raster map where? <br>
<br>
Nikos <o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><span
style="color:windowtext;mso-fareast-language:EN-US"
lang="EN-GB">In the active map display (and respective
Layer manager) as d.rast do it with gui...<br>
</span><br>
Frank<o:p></o:p></p>
</blockquote>
</blockquote>
</div>
</blockquote>
</body>
</html>