[GRASS5] Some problmes with Grass 5beta8 - d.rast, ps.map, d.what.x

Andreas Lange Andreas.Lange at Rhein-Main.de
Sat Nov 25 12:12:37 EST 2000


Dear Tom,

For your question ONE i can not say anything useful.

tstrang wrote:
> ONE - Map production


To your question TWO:

> TWO - Querying withing tcltkgrass
> 
> I posted a request for fixing d.what.sites as it returns two identical
> entries to the tcltk window, and saves them to file. A response was
> made to the list that this is a feature not a bug. I cannot let this
> pass as I find the behaviour of the command irksome. If I want fancy
> redirection I'll build it in the command line with <>&tee etc. There is
> always a nice terminal open when one runs Grass :-) To illustrate my
> reason for calling this behaviour a bug I've tabulated the behaviour
> of the whole d.what family as of 5b8 to show inconsistencies...

First there was a misunderstanding on my side:
You said "save to file" (from the tcltkgrass-window), i understand
"redirected to a file" (from commandline). 

The fact that the output is echoed twice in the tcltkgrass-window is an
artifact arizing from the internals of the d.what.* programs:
The programs test if the output is redirected (that is if stdout is
redirected to a file). If yes, they echo the user messages to stderr, so
that you see some feedback. The module counts the lines already output
and if a certain count is reached, the user message is put out again
(page-break). 

The programs have been written ages ago, when graphics windows and
terminal windows usually where on different monitors.

The tcltkgrass program places just fancy windows around the commands and
calls the programs with the parameters you supply. 
But the output of the programs is re-directed internallay to a window.
So the program checks if stdout is redirected and prints everything once
to stdout and once to stderr. Both output is collected in one window
from tcltkgrass.


What i have done so far:
I added the -1 flag to d.what.sites. So that should be consistent now.

I changed d.what.sites to echo on each mouse-click.

I changed d.what.vect the same way.

All three modules now have the flags -1 for only one ident, -t for terse
output (without the page-breaks and user messages). 

For the double output in the tcltkgrass-window there is no fix, as this
would require re-organizing the whole tcltkgrass-code. Any volunteers or
sponsors around? Or it would break the commandline-usage. 

But if you need the output in a file, please use d.what.* programs from
the commandline (you have always an open shell window?) and redirect the
output to the file. You will spare two additional mouse-clicks by this
way ;-).

> 
> d.what.rast:
> 
> 1) Single-query-mode: Prints user-instructions and returns two unique
> lines immediately on clicking with quantized and actual elevations.
> 
> 2) Multi-query-mode: Prints user-instructions but then duplicates are
> returned of each two line result. Every four clicks the
> user-instruction repeats and also gets saved into files.
> 
> Why not put the user-instruction stuff permanently as tcltk window
> dressing as with other hints about appropriate behaviour/choices
> instead of contaminating the output of a useful function forcing us to
> filter off the stuff if we want to *use* the result? And no, I don't
> what to run more filtering scripts than I have to :-)
> 
> d.what.vect:
> 
> 1) Single-query-mode: Prints user-instructions and returns two
>    lines. The top line has Northing and Easting or is it Easting and
>    Northing. Vector and Site files swap the order - a little N or E
>    would help me out here if standardization is impossible :-)
> 
> 2) Multi-query mode: Prints user-instructions which as stated above
> contaminate file - we don't need to know about mouse instructions
> after the file is made :-). Shows results on click - very good for
> user feedback that the routine works.
> 
> d.what.sites:
> 
> 1) Single-query-mode: Fails to work and complains:  Sorry, <1> is not a
> valid flag
> This flag is common to the sister rast and vect commands.
> 
> 2) Multi-query-mode: Prints sitefile header stuff, prints
>    user-instructions, *does not* print out sites as clicked - only
>    dumps them on right-click exiting the process. This is inconsistent
>    with the other two commands and is not good gui :-) no feedback to
>    user that the mouse is not malfunctioning.
> 
> So, this is the long version of my request for a bugfix on d.what.rast
> and d.what.sites. Only d.what.rast multi-query-mode has the dubious
> feature of duplicating your results to screen/file. All three
> needlessly contaminate the output with gui instructions that should be
> on the window as static text. d.what.sites single-query-mode is broken.
> 

Please do not expect too much from tcltkgrass. It may not be obvious to
the average user, but GUI-building is an extremly time- and
cost-comsuming thing. The current setup is a very clean and
straightforward design, every setup that would require writing code for
each of the ~300 GRASS modules would be far too much work. 

cu,

Andreas

-- 
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange at Rhein-Main.de - A.C.Lange at GMX.net



---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list