Adding map to layer manager (wxpython GUI) from grass console?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding map to layer manager (wxpython GUI) from grass console?

Joe-5
Hi all,
I'm trying to follow a Grass tutorial in which it is described how to
use grass with --wxpython GUI: when grass is launched from linux
terminal, a Layer Manager and a Map Display appears along Grass
Console in my terminal. I noticed some grass commands run as expected
also if I input them from grass console. But if I want to add for
example a raster map to the layer manager I can't do it by textual
console: if I click on the GUI button "add raster map", it works and
the corresponding textual command appears at GUI status bar. I read:

d.rast map=basins@PERMANENT

The result is the "basins" map added in the layers list of the layer
manager GUI, ok. Now look what happens if I try to remove the map and
launch the command above "by hand", at the grass console:
------------------------------------------------------------------------------------------------
GRASS 7.2.2 (gisdemo_ncspm):~ > d.rast map=basins@PERMANENT
ERROR: Neither MONITOR (managed by d.mon command) nor
       GRASS_RENDER_IMMEDIATE (used for direct rendering) defined
------------------------------------------------------------------------------------------------

How can I add a map to the GUI layer using a textual command in grass console?
Many thanks in advance!
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Adding map to layer manager (wxpython GUI) from grass console?

Rich Shepard
On Wed, 6 Feb 2019, Joe wrote:

> GRASS 7.2.2 (gisdemo_ncspm):~ > d.rast map=basins@PERMANENT
> ERROR: Neither MONITOR (managed by d.mon command) nor
>       GRASS_RENDER_IMMEDIATE (used for direct rendering) defined
> ------------------------------------------------------------------------------------------------

Joe,

First, open a display monitor:

d.mon start=wx0

When you're finished, close the monitor:

d.mon stop=wx0

Of course, you can open multiple monitors (I don't know the maximum as I've
used only 2 at most) by incrementing the wxN integer.

HTH,

Rich
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Adding map to layer manager (wxpython GUI) from grass console?

Joe-5
On Wed, Feb 6, 2019 at 4:53 PM Rich Shepard <[hidden email]> wrote:

>
> First, open a display monitor:
>
> d.mon start=wx0
>
> When you're finished, close the monitor:
>
> d.mon stop=wx0
>
> Of course, you can open multiple monitors (I don't know the maximum as I've
> used only 2 at most) by incrementing the wxN integer.

Thanks for yuor answer Rich, but in that way we would work on a new
"stand alone" window (monitor), "basins" map is not added to the
wxPython "Layer Manager". Look at this screenshot:
https://cdn.pbrd.co/images/I028MO5.jpg

We have wxpython GUI on the left with "Layer Manager" at top and "Map
Display" at the bottom. On the right the new monitor window "wx0" and
the terminal with grass prompt. As you can see the layer manager is
empty.

If I type the same command "d.rast basins@PERMANENT" at the layer
manager console (top-left), the map is displayed in Map Display window
and a new "layer" is added to the "Layers" tab of the layer manager:
https://cdn.pbrd.co/images/I02qjCR.jpg
https://cdn.pbrd.co/images/I02rk6A.jpg

The question was: can I add the raster map "basins@PERMANENT" to the
layer manager layers list by type a command at the terminal console
(not using the wxpyton gui console)?
Hope my poor english is clear enought to explain what I'm trying to do.

Thanks again!
Bye
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Adding map to layer manager (wxpython GUI) from grass console?

Veronica Andreo
Hi Joe

El jue., 7 feb. 2019 07:35, Joe <[hidden email]> escribió:
On Wed, Feb 6, 2019 at 4:53 PM Rich Shepard <[hidden email]> wrote:
>
> First, open a display monitor:
>
> d.mon start=wx0
>
> When you're finished, close the monitor:
>
> d.mon stop=wx0
>
> Of course, you can open multiple monitors (I don't know the maximum as I've
> used only 2 at most) by incrementing the wxN integer.

Thanks for yuor answer Rich, but in that way we would work on a new
"stand alone" window (monitor), "basins" map is not added to the
wxPython "Layer Manager". Look at this screenshot:
https://cdn.pbrd.co/images/I028MO5.jpg

We have wxpython GUI on the left with "Layer Manager" at top and "Map
Display" at the bottom. On the right the new monitor window "wx0" and
the terminal with grass prompt. As you can see the layer manager is
empty.

If I type the same command "d.rast basins@PERMANENT" at the layer
manager console (top-left), the map is displayed in Map Display window
and a new "layer" is added to the "Layers" tab of the layer manager:
https://cdn.pbrd.co/images/I02qjCR.jpg
https://cdn.pbrd.co/images/I02rk6A.jpg

The question was: can I add the raster map "basins@PERMANENT" to the
layer manager layers list by type a command at the terminal console
(not using the wxpyton gui console)?

No, you can't. The terminal does not control the layer manager nor the main map display. From the terminal you need to open a wx monitor and then display maps there.

The main gui map display is controlled with the icons or the console tab in the layer manager.

HTH,
Vero


_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Adding map to layer manager (wxpython GUI) from grass console?

Joe-5
Thanks a lot Veronica!

An other question: what way would you suggest to focus on for learning purpose?
Monitors and terminal console, or a GUI based approach?

Thank you again for you reply!  :)

On Thu, Feb 7, 2019 at 11:50 AM Veronica Andreo <[hidden email]> wrote:

>
> Hi Joe
>
> El jue., 7 feb. 2019 07:35, Joe <[hidden email]> escribió:
>>
>> On Wed, Feb 6, 2019 at 4:53 PM Rich Shepard <[hidden email]> wrote:
>> >
>> > First, open a display monitor:
>> >
>> > d.mon start=wx0
>> >
>> > When you're finished, close the monitor:
>> >
>> > d.mon stop=wx0
>> >
>> > Of course, you can open multiple monitors (I don't know the maximum as I've
>> > used only 2 at most) by incrementing the wxN integer.
>>
>> Thanks for yuor answer Rich, but in that way we would work on a new
>> "stand alone" window (monitor), "basins" map is not added to the
>> wxPython "Layer Manager". Look at this screenshot:
>> https://cdn.pbrd.co/images/I028MO5.jpg
>>
>> We have wxpython GUI on the left with "Layer Manager" at top and "Map
>> Display" at the bottom. On the right the new monitor window "wx0" and
>> the terminal with grass prompt. As you can see the layer manager is
>> empty.
>>
>> If I type the same command "d.rast basins@PERMANENT" at the layer
>> manager console (top-left), the map is displayed in Map Display window
>> and a new "layer" is added to the "Layers" tab of the layer manager:
>> https://cdn.pbrd.co/images/I02qjCR.jpg
>> https://cdn.pbrd.co/images/I02rk6A.jpg
>>
>> The question was: can I add the raster map "basins@PERMANENT" to the
>> layer manager layers list by type a command at the terminal console
>> (not using the wxpyton gui console)?
>
>
> No, you can't. The terminal does not control the layer manager nor the main map display. From the terminal you need to open a wx monitor and then display maps there.
>
> The main gui map display is controlled with the icons or the console tab in the layer manager.
>
> HTH,
> Vero
>
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Adding map to layer manager (wxpython GUI) from grass console?

Veronica Andreo
Hi Joe,

well, I personally combine both depending on the task on hand. Most of the time, I only use terminal though. When you start learning GRASS, there's a nice feature of the GUI that allows to copy the command once you have set all the options in GUI of that command. Like this you can copy the commands into a text file and then comment and modify there, which allows for reproducibility very easily

There's a lot of material online that you can follow, for example:
 - https://gitlab.com/veroandreo/curso-grass-gis-rioiv (links to presentations and exercises in the README)

cheers,
Vero

El jue., 7 feb. 2019 a las 13:59, Joe (<[hidden email]>) escribió:
Thanks a lot Veronica!

An other question: what way would you suggest to focus on for learning purpose?
Monitors and terminal console, or a GUI based approach?

Thank you again for you reply!  :)

On Thu, Feb 7, 2019 at 11:50 AM Veronica Andreo <[hidden email]> wrote:
>
> Hi Joe
>
> El jue., 7 feb. 2019 07:35, Joe <[hidden email]> escribió:
>>
>> On Wed, Feb 6, 2019 at 4:53 PM Rich Shepard <[hidden email]> wrote:
>> >
>> > First, open a display monitor:
>> >
>> > d.mon start=wx0
>> >
>> > When you're finished, close the monitor:
>> >
>> > d.mon stop=wx0
>> >
>> > Of course, you can open multiple monitors (I don't know the maximum as I've
>> > used only 2 at most) by incrementing the wxN integer.
>>
>> Thanks for yuor answer Rich, but in that way we would work on a new
>> "stand alone" window (monitor), "basins" map is not added to the
>> wxPython "Layer Manager". Look at this screenshot:
>> https://cdn.pbrd.co/images/I028MO5.jpg
>>
>> We have wxpython GUI on the left with "Layer Manager" at top and "Map
>> Display" at the bottom. On the right the new monitor window "wx0" and
>> the terminal with grass prompt. As you can see the layer manager is
>> empty.
>>
>> If I type the same command "d.rast basins@PERMANENT" at the layer
>> manager console (top-left), the map is displayed in Map Display window
>> and a new "layer" is added to the "Layers" tab of the layer manager:
>> https://cdn.pbrd.co/images/I02qjCR.jpg
>> https://cdn.pbrd.co/images/I02rk6A.jpg
>>
>> The question was: can I add the raster map "basins@PERMANENT" to the
>> layer manager layers list by type a command at the terminal console
>> (not using the wxpyton gui console)?
>
>
> No, you can't. The terminal does not control the layer manager nor the main map display. From the terminal you need to open a wx monitor and then display maps there.
>
> The main gui map display is controlled with the icons or the console tab in the layer manager.
>
> HTH,
> Vero
>
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Adding map to layer manager (wxpython GUI) from grass console?

Joe-5
On Thu, Feb 7, 2019 at 2:42 PM Veronica Andreo <[hidden email]> wrote:
>
> well, I personally combine both depending on the task on hand. Most of the time, I only use terminal though. When you start learning GRASS, there's a nice feature of the GUI that allows to copy the command once you have set all the options in GUI of that command. Like this you can copy the commands into a text file and then comment and modify there, which allows for reproducibility very easily
>
> There's a lot of material online that you can follow, for example:
>  - https://gitlab.com/veroandreo/curso-grass-gis-rioiv (links to presentations and exercises in the README)
>  - http://training.gismentors.eu/grass-gis-irsae-winter-course-2018/

Ok Veronica, interesting links, I'll take a closer look at them, thanks again!
Bye!  :D
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Adding map to layer manager (wxpython GUI) from grass console?

Ken Mankoff
In reply to this post by Joe-5

On 2019-02-07 at 13:58 +0100, Joe <[hidden email]> wrote...
> An other question: what way would you suggest to focus on for learning
> purpose? Monitors and terminal console, or a GUI based approach?

I'll offer opposing view. Terminal. CLI is more powerful than GUI.

  -k.
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Adding map to layer manager (wxpython GUI) from grass console?

Rich Shepard
On Thu, 7 Feb 2019, Ken Mankoff wrote:

> I'll offer opposing view. Terminal. CLI is more powerful than GUI.

+1 And, you can put the commands in a script (with comments) so it can be
used again. This is particularly valuable when the work flow is large or to
be repeated on multiple data sets.

Rich
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Adding map to layer manager (wxpython GUI) from grass console?

Joe-5
On Thu, Feb 7, 2019 at 5:49 PM Rich Shepard <[hidden email]> wrote:

>
> On Thu, 7 Feb 2019, Ken Mankoff wrote:
>
> > I'll offer opposing view. Terminal. CLI is more powerful than GUI.
>
> +1 And, you can put the commands in a script (with comments) so it can be
> used again. This is particularly valuable when the work flow is large or to
> be repeated on multiple data sets.
>
> Rich

Ok, thank to you too for your suggests.
I know bash scripting pretty well, if grass scripting is similar I
should be quite at ease with it (while I'm a really newbie at python
programming, I don't exactly know what it is for but there is a python
shell tab in the GUI).
As Veronica showed, there's a lot of documentation around on the net:
would you also suggest a good text book or you think it shouldn't be
necessary for a beginner to learn grass?
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Adding map to layer manager (wxpython GUI) from grass console?

Rich Shepard
On Thu, 7 Feb 2019, Joe wrote:

> I know bash scripting pretty well, if grass scripting is similar I should
> be quite at ease with it

Joe,

Since you're writing GRASS commands in a script that you'd enter from the
console, the script is a bash shell script. Just begin it as usual using
#!/usr/bin/bash
and enter commands as you would from the GRASS prompt.

> As Veronica showed, there's a lot of documentation around on the net:
> would you also suggest a good text book or you think it shouldn't be
> necessary for a beginner to learn grass?

GRASS changes pretty rapidly. My advice to you as a new user is look at some
of the application examples that are relevant to what you want to do. You
can also browse the module manual pages, including the add-ons.

HTH,

Rich
_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user