[GRASS-user] r.reclass not spawning xterm on Mac OS X

I've been trying to run r.reclass on my G5 using the precompiled binary for 6.2 and the Mac OS X frameworks (ActiveTcl, too). Running r.reclass from the terminal spawns a GUI window, into which I enter the raster layer and the result's name. After pressing "run", no xterm window spawns to allow me to interactively set the rules. Is there any way to solve this?

Thanks,
Tim

__________________________________________
Tim De Chant
     University of California, Berkeley
     Environmental Science, Policy, and Management
     137 Mulford Hall #3114
     Berkeley, CA 94720-3114
     (510) 643-3910

Try using this command in the GRASS terminal:
r.reclass input=[input raster name] output=[name of reclassed raster]

It will output:
Enter rule(s), "end" when done, "help" if you need it
Data range is ### to ###

If you type help it will say:
> help
Enter a rule in one of these formats:
1 3 5 = 1 poor quality
1 thru 10 = 1
20 thru 50 = 2 medium quality
* = NULL
>

rsb

Tim De Chant wrote:

I've been trying to run r.reclass on my G5 using the precompiled binary for 6.2 and the Mac OS X frameworks (ActiveTcl, too). Running r.reclass from the terminal spawns a GUI window, into which I enter the raster layer and the result's name. After pressing "run", no xterm window spawns to allow me to interactively set the rules. Is there any way to solve this?

Thanks,
Tim

__________________________________________
Tim De Chant
    University of California, Berkeley
    Environmental Science, Policy, and Management
    137 Mulford Hall #3114
    Berkeley, CA 94720-3114
    (510) 643-3910

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

You have to run r.reclass with arguments to get to the xterm interface. From
the GIS Manager, there is a script that does this.

Running r.reclass without arguments will open a GUI that is pretty useless.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Tim De Chant <dechant@nature.berkeley.edu>
Date: Wed, 8 Nov 2006 14:07:40 -0800
To: <grassuser@grass.itc.it>
Subject: [GRASS-user] r.reclass not spawning xterm on Mac OS X

I've been trying to run r.reclass on my G5 using the precompiled
binary for 6.2 and the Mac OS X frameworks (ActiveTcl, too). Running
r.reclass from the terminal spawns a GUI window, into which I enter
the raster layer and the result's name. After pressing "run", no
xterm window spawns to allow me to interactively set the rules. Is
there any way to solve this?

Thanks,
Tim

__________________________________________
Tim De Chant
     University of California, Berkeley
     Environmental Science, Policy, and Management
     137 Mulford Hall #3114
     Berkeley, CA 94720-3114
     (510) 643-3910

> I've been trying to run r.reclass on my G5 using the precompiled
> binary for 6.2 and the Mac OS X frameworks (ActiveTcl, too).
> Running r.reclass from the terminal spawns a GUI window, into which
> I enter the raster layer and the result's name. After pressing
> "run", no xterm window spawns to allow me to interactively set the
> rules. Is there any way to solve this?

Michael Barton wrote:

You have to run r.reclass with arguments to get to the xterm
interface. From the GIS Manager, there is a script that does this.

Running r.reclass without arguments will open a GUI that is pretty
useless.

the general solution to this is to force the module not to run in GUI
mode by setting the GRASS_UI_TERM enviro variable.

e.g., from r.digit:

    /* must run in a term window */
    G_putenv("GRASS_UI_TERM","1");

    /* Initialize the GIS calls */
    G_gisinit(argv[0]) ;

then in menu.tcl:
   -command {term r.digit }}

no need for wrapper scripts this way..

I don't use r.reclass so can't really comment on whether that is the
best thing for the module. (is it always interactive in a terminal?)

Hamish

I'd forgotten about this environmental variable. So I tried it out to remind
myself how it worked. Overall, it isn't much of an advantage, at least in
the case of r.reclass and absolutely will not work in the TclTk GUI.

What is does is put the command back into the old interactive terminal mode.
So for r.reclass, if GRASS_UI_TERM=0, you need to type ...

r.reclass input=[old_map] output=[new_map]

...to get to the interactive terminal screen where you can put in reclass
statements.

If GRASS_UI_TERM=1 and you simply type r.reclass, you are prompted in the
terminal to enter the [old_map] and [new_map] before you can get to the same
terminal screen to put in reclass statements.

Because it requires interactive xterm use (query/response), it cannot be
used in the TclTk GUI platform.

Oh well.

It is a very useful module, IMHO, because it offers the chance to maintain
multiple views of a raster map and use only a tiny bit of disk space.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Hamish <hamish_nospam@yahoo.com>
Date: Thu, 9 Nov 2006 17:14:46 +1300
To: Michael Barton <michael.barton@asu.edu>
Cc: <dechant@nature.berkeley.edu>, <grassuser@grass.itc.it>
Subject: Re: [GRASS-user] r.reclass not spawning xterm on Mac OS X

I've been trying to run r.reclass on my G5 using the precompiled
binary for 6.2 and the Mac OS X frameworks (ActiveTcl, too).
Running r.reclass from the terminal spawns a GUI window, into which
I enter the raster layer and the result's name. After pressing
"run", no xterm window spawns to allow me to interactively set the
rules. Is there any way to solve this?

Michael Barton wrote:

You have to run r.reclass with arguments to get to the xterm
interface. From the GIS Manager, there is a script that does this.

Running r.reclass without arguments will open a GUI that is pretty
useless.

the general solution to this is to force the module not to run in GUI
mode by setting the GRASS_UI_TERM enviro variable.

e.g., from r.digit:

    /* must run in a term window */
    G_putenv("GRASS_UI_TERM","1");

    /* Initialize the GIS calls */
    G_gisinit(argv[0]) ;

then in menu.tcl:
   -command {term r.digit }}

no need for wrapper scripts this way..

I don't use r.reclass so can't really comment on whether that is the
best thing for the module. (is it always interactive in a terminal?)

Hamish

Michael Barton wrote:

You have to run r.reclass with arguments to get to the xterm interface. From
the GIS Manager, there is a script that does this.

Running r.reclass without arguments will open a GUI that is pretty useless.

A couple of potentially useful enhancements:

1. Add a rules= option to r.reclass which accepts the name of a file
containing reclass rules.

2. Add a button to the standard dialogs which allows stdin to be
redirected from a user-specified file.

Either of those would allow r.reclass to be usable without a terminal.

There's still the general issue of what we do about
terminal-interactive modules. So long as at least one such module
exists, the issue remains.

Either we decide to "kill them all", and declare all use of stdin to
be a bug, or we need some way for a module to indicate that it needs
(or may need) a terminal. The latter is complicated by the fact that a
module may only require a terminal in certain circumstances.

Comments? Please. I'd *really* like to get this issue dealt with; it's
been coming up since the days of d.m (maybe even since tcltkgrass).

--
Glynn Clements <glynn@gclements.plus.com>