2

I'm trying to learn command-line GRASS (6.4.3) using the KyngChaos binaries on a Mac (10.8.4) from Neteler and Mitasova's book, Open Source GIS: A GRASS GIS Approach (3rd ed.). I've learned from this site that some of the commands in the book have been deprecated with the introduction of the wxGUI. Is d.mon one of those commands that has been deprecated? I've found that I can still invoke a X11 graphics monitor using d.mon, but is it preferable to use the graphics monitor in the wxGUI? If so, then can I access the wxGUI's graphics monitor from a terminal session? I'm finding that the command console in the wxGUI behaves somewhat unpredictably compared to a terminal (e.g. I can't cd to change working directory).

Also, am I likely to continue running into inconsistencies between the book and the current version of the software as I work my way through the book?

1
  • Please edit this and add a) which GRASS GIS version you are using and b) on which operating system you are.
    – markusN
    Commented Sep 10, 2013 at 21:02

2 Answers 2

2

d.mon

In GRASS GIS 7, d.mon xN is (will be) replaced by d.mon wxN (manual page). These new wxPython-based monitors works in the same way as the X11-based monitors and have several advantages.

They can be controlled from the command line (e.g., using d.rast elevation) and using mouse in the same way as the map display in the main wxGUI (g.gui) is controlled thanks to the fact that wxPython-based monitors share the code and functionality with the main GUI.

Some of the d.* modules/commands have been removed because they were replaced by some better way or just does not make sense for the new system. Some non-display modules/commands which combined computational and display functionality were modified to split GUI and computations (e.g. r.spread -d flag for animating output on X11 monitor was removed and will be replaced by the combination of time series output and animation tool in the future).

Currently, the only known advantage of the X11-based monitors over the wxPython-based monitors is the speed.

Alternatively, you can use certain display modules/commands (e.g. d.vect streets) in Command console in the main GUI. The interface is the same as in command line (you type commands) but the result is the exactly same as adding layer with mouse and dialogs. And there is also a command layer (something like sixth icon on map tool bar, Add various layers -> Add command layer) which allows you to input any display command you want. This is available in both GRASS 6 and GRASS 7.

Command console

From what I have seen, command line users (on Linux and Mac) usually prefer the real command line over the Command console in GUI, although it has special GRASS-related auto-complete functions (try Tab, Ctrl+Space and g. and g.region rast=). The cd command should work, so I think it is a bug (see GRASS issue #2152). The workaround is to start GRASS (grass*) or GUI (g.gui) in the right directory or use GUI way to change it Settings -> GRASS working environment -> Change working directory (available only in GRASS 7 and it's absurd but it is workaround).

0

Is d.mon one of those commands that has been deprecated?

In the GRASS GIS version 6.4.x series, the d.mon xN module(s) are fully functional and supported. The X monitors have been dropped in (up-coming but fully operational) GRASS GIS version 7.

...is it preferable to use the graphics monitor in the wxGUI?

I think it is a matter of taste and convenience. I guess that many still use the X monitors for everyday tasks. Other still might use the tcltk GUI. It is possible to use, of course, the wxGUI within from GRASS GIS ver. 6.4 and probably, is my skepsis, more people use the newer GUI than the old one.

...can I access the wxGUI's graphics monitor from a terminal session?

On the matter, you can enter a GRASS session from the command line in text mode (grass -text) and later on, launch the wxGUI without sacrificing the "normal" terminal session. You only need to instruct g.gui gui=wxpython &. The & following a shell command forces the given command to run in the background.

...the command console in the wxGUI behaves somewhat unpredictably compared to a terminal (e.g. I can't cd to change working directory).

Not sure if this "should be" true, i.e. if the strange behaviour is a buggy behaviour. I can work in wxGUI's Command Console with several regular shell commands. However, the cd command doesn't seem to respond as expected. Note, the Command Console is to be confused with the interactive Python Shell. Maybe ask in the grass-dev mailing list or/and report a ticket in GRASS GIS' Trac System

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.