[GRASS-dev] Shell scripts
glynn at gclements.plus.com
Thu Nov 26 20:56:14 EST 2009
Michael Barton wrote:
> > If you want to be able to control the GUI from the command line, that
> > should be dealt with as an infrastructure issue, not by creating
> > wrappers around individual commands.
> > I can deal with the display/driver libraries, and with generic Python
> > IPC, but some of it will need the involvement of someone who
> > understands the GUI.
> Winter break is near and I'll be laid up for a week. So I might be
> able to help.
> Controlling the GUI from the command line is a contradiction in
> interface terms. Perhaps you really mean displaying a map from the
> command line?
I mean controlling the GUI, i.e. being able to modify the list of
displayed maps. That's what the p.* scripts appear to be doing.
> If you don't want to use a mouse, there isn't much point in trying to
> work with the wxGUI map display canvas as it is--with all of its
> buttons and menus and a lot of other functionality built in. It's not
> impossible to break into it, but it is not easy either--which is why
> the p.* scripts remain non- or only semi-functional. Also, I suspect
> that command-line only display will be important primarily for users
> of Linux. So it seems like a better solution is to have a reasonably
> easy command line way to composite maps and display them (perhaps in
> pnm or png format) in a Linux-based viewer.
> Glynn has mentioned the possibility of this and most of the tools
> already exist. Probably a python script could be created to 1) allow a
> user to specify a list of vector and raster maps to overlay, 2) set
> the output file grass variable and recursively cycle through d.vect
> and d.rast, 3) run the pnm files through g.pnmcomp to composite them,
> and 4) display the composited map in a Linux viewer utility of some
> sort. d.out.file might be useful as a model to get this started. If
> someone wants to attempt this, I'm happy to offer advice on the Python
> Another option could be a simplified interface to ps.map, enter maps
> only or maps and a couple of overlay options like a scale and north
> arrow, and use ps.map to do the compositing. Then display the result
> in a ps viewer. These could also be combined in a Python script. There
> used to be a TclTk script for most of this. This might produce higher
> quality visualization and has the added benefit of simultaneously
> producing high quality print files.
Except, what appears to be desired is the ability to control wxGUI
from the command line, not a separate program for command-line use.
At the simplest level, the GUI just needs to implement the equivalent
of Tcl/Tk's "send", leaving the burden of constructing valid commands
with the client.
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev