[GRASS-user] neither monitor <managed by d.mon command> nor grass_render_imidiate defined

So, this error happens when i try to run the d.vect command on python console:

g.run_command(‘d.vect’, map=‘bore0@Map’)

strange is that d.vect runs fine on command console, but as im iterating on a list, i need to run on python.

I have found this issue that outputs a similar error:
https://trac.osgeo.org/grass/ticket/2521

but when i tried to run the ‘d.mon wx0’ command it gives the error:

Command ‘d.mon’ not yet implemented in the WxGUI. Try adding it as a command layer instead.

Any tips? should i go to linux instead? the problem in that i didnt found a easy install for Grass 7 on Debian, and the apt-get reference was (last week) pointing to 6.4.4 yet.

Tnks,
Alec.

On Sun, Dec 13, 2015 at 7:17 PM, Alec Ventura <alecventura@hotmail.com> wrote:

So, this error happens when i try to run the d.vect command on python console:

g.run_command(‘d.vect’, map=‘bore0@Map’)

strange is that d.vect runs fine on command console, but as im iterating on a list, i need to run on python.

What you want to use is Python, not the GUI command console and d.mon as you are trying below but in Python. I suppose you want to render to a file. The code should look like something like this:

gscript.run_command(‘r.relief’, input=raster, output=shaded_relief)
gscript.run_command(‘d.mon’, start=‘cairo’, output=raster + ‘.png’,
width=400, height=400)
gscript.run_command(‘d.shade’, shade=shaded_relief, color=raster)
gscript.run_command(‘d.mon’, stop=‘cairo’)

More robust alternative to d.mon are environmental variables:

https://grass.osgeo.org/grass70/manuals/cairodriver.html

Rendering to file can be done from Python or from the system command line (on MS Windows the black one).

Hope this helps, see more comments below,

Vaclav

but when i tried to run the ‘d.mon wx0’ command it gives the error:

Command ‘d.mon’ not yet implemented in the WxGUI. Try adding it as a command layer instead.

It seems that you are doing this in the GUI command line. That one is meant for simple tasks and GUI-related things only, so you can’t use d.* command in this way there.

Any tips? should i go to linux instead?

This should work on any operating system but there are many other reasons to use Linux and there is many happy Linux users among the GRASS GIS users.

the problem in that i didnt found a easy install for Grass 7 on Debian, and the apt-get reference was (last week) pointing to 6.4.4 yet.

I’m not familiar enough with Debian to know how to install latest GRASS. If the particular distribution doesn’t matter for you, you can try Ubuntu.You need to add a . The instructions are on GRASS GIS website.

I didn’t want to put it on a file, at least for now. I want to make a 3d boreholes very similar to:
http://osgeo-org.1560.x6.nabble.com/Automatic-3D-geological-boreholes-representation-automate-v-extrude-from-a-table-my-solution-in-Pythn-td4978801.html

so i would like to add the boreholes to my current interface… the problem is: when i run the loop:

for i in range(len(boreholesList)):
boreholeName = “bore”+str(i)
g.run_command(‘v.extract’,input=mapWithBuffer, list=i+1, output=‘tmp’,type=‘area’, quiet=True, overwrite=True)
g.run_command(‘v.extrude’, input=‘tmp’, output=boreholeName, zshift=float(boreholesList[i][2]),height= float(boreholesList[i][5]),overwrite=True)
g.run_command(‘g.remove’, type=‘vector’, name=‘tmp’, flags = ‘f’)
g.run_command(‘d.vect’, map=boreholeName)

the last command (d.vect) gives an error saing that it needs a monitor, so when i run ‘d.mon -l’ the is no monitor running, and when i run a ‘d.mon start=“wx0”’ then it starts a new interface where i can add the vectors… but then i cant do a ‘zoom to layer’ command (because i dont know how).

The ideal would be to use the current interface instead of open a new one right? i dont know why the ‘d.vect’ command requires a monitor on python.
I will apreciate any tips
Alec.


From: wenzeslaus@gmail.com
Date: Sun, 13 Dec 2015 22:38:14 -0500
Subject: Re: [GRASS-user] neither monitor nor grass_render_imidiate defined
To: alecventura@hotmail.com
CC: grass-user@lists.osgeo.org

On Sun, Dec 13, 2015 at 7:17 PM, Alec Ventura <alecventura@hotmail.com> wrote:

So, this error happens when i try to run the d.vect command on python console:

g.run_command(‘d.vect’, map=‘bore0@Map’)

strange is that d.vect runs fine on command console, but as im iterating on a list, i need to run on python.

What you want to use is Python, not the GUI command console and d.mon as you are trying below but in Python. I suppose you want to render to a file. The code should look like something like this:

gscript.run_command(‘r.relief’, input=raster, output=shaded_relief)
gscript.run_command(‘d.mon’, start=‘cairo’, output=raster + ‘.png’,
width=400, height=400)
gscript.run_command(‘d.shade’, shade=shaded_relief, color=raster)
gscript.run_command(‘d.mon’, stop=‘cairo’)

More robust alternative to d.mon are environmental variables:

https://grass.osgeo.org/grass70/manuals/cairodriver.html

Rendering to file can be done from Python or from the system command line (on MS Windows the black one).

Hope this helps, see more comments below,

Vaclav

but when i tried to run the ‘d.mon wx0’ command it gives the error:

Command ‘d.mon’ not yet implemented in the WxGUI. Try adding it as a command layer instead.

It seems that you are doing this in the GUI command line. That one is meant for simple tasks and GUI-related things only, so you can’t use d.* command in this way there.

Any tips? should i go to linux instead?

This should work on any operating system but there are many other reasons to use Linux and there is many happy Linux users among the GRASS GIS users.

the problem in that i didnt found a easy install for Grass 7 on Debian, and the apt-get reference was (last week) pointing to 6.4.4 yet.

I’m not familiar enough with Debian to know how to install latest GRASS. If the particular distribution doesn’t matter for you, you can try Ubuntu.You need to add a . The instructions are on GRASS GIS website.

On Sun, Dec 13, 2015 at 10:51 PM, Alec Ventura <alecventura@hotmail.com>
wrote:

I didn't want to put it on a file, at least for now. I want to make a 3d
boreholes very similar to:

http://osgeo-org.1560.x6.nabble.com/Automatic-3D-geological-boreholes-representation-automate-v-extrude-from-a-table-my-solution-in-Pythn-td4978801.html

so i would like to add the boreholes to my current interface... the
problem is: when i run the loop:
for i in range(len(boreholesList)):
    boreholeName = "bore"+str(i)
    g.run_command('v.extract',input=mapWithBuffer, list=i+1,
output='tmp',type='area', quiet=True, overwrite=True)
    g.run_command('v.extrude', input='tmp', output=boreholeName,
zshift=float(boreholesList[i][2]),height=
float(boreholesList[i][5]),overwrite=True)
    g.run_command('g.remove', type='vector', name='tmp', flags = 'f')
    g.run_command('d.vect', map=boreholeName)

Wouldn't patching all the created vector maps together and then displaying
just the one the right thing to do?

the last command (d.vect) gives an error saing that it needs a monitor, so
when i run 'd.mon -l' the is no monitor running,

d.vect needs to draw the image somewhere.

and when i run a 'd.mon start="wx0"' then it starts a new interface where
i can add the vectors... but then i cant do a 'zoom to layer' command
(because i dont know how).

d.mon wx0 has a toolbar similar to the one in Map Display. You should be
able to use the various zoom buttons there as well as mouse wheel.

The ideal would be to use the current interface instead of open a new one
right?

GUI doesn't know about what is happening in your Python script and it is
not connected to the rendering/monitor system. d.mon serves this role.

i dont know why the 'd.vect' command requires a monitor on python.

As I said, d.vect needs to draw the image somewhere.

I'm not sure if I understand what behavior you actually expect to see.