[GRASS5] fixed 2 bugs in GIS Manager GRASS 6

I just fixed 2 bugs in the GIS Manager for GRASS 6 that prevented r.terraflow and d.colors from operating via the menus. I looked on the bugtracker system to report them fixed but either a) I was unable to properly search for them or b) neither was reported via the bugtracker.

I have some improvements to the GIS Manager but will hold off until 6.0 is released. Any word on when that will be?

Michael


Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Michael Barton wrote:

I just fixed 2 bugs in the GIS Manager for GRASS 6 that prevented
r.terraflow and d.colors from operating via the menus. I looked on the
bugtracker system to report them fixed but either a) I was unable to
properly search for them or b) neither was reported via the bugtracker.

I have some improvements to the GIS Manager but will hold off until 6.0 is
released. Any word on when that will be?

Next week?

Radim

> I just fixed 2 bugs in the GIS Manager for GRASS 6 that prevented
> r.terraflow and d.colors from operating via the menus. I looked on
> the bugtracker system to report them fixed but either a) I was
> unable to properly search for them or b) neither was reported via
> the bugtracker.
>
> I have some improvements to the GIS Manager but will hold off until
> 6.0 is released. Any word on when that will be?

Next week?

It would be nice to get v.surf.rst (2x #2990) and missing opt->key_desc
bugs (#3002) fixed first.

http://intevation.de/rt/webrt?serial_num=2990
http://intevation.de/rt/webrt?serial_num=3002

Hamish

Hamish wrote:

I just fixed 2 bugs in the GIS Manager for GRASS 6 that prevented
r.terraflow and d.colors from operating via the menus. I looked on
the bugtracker system to report them fixed but either a) I was
unable to properly search for them or b) neither was reported via
the bugtracker.

I have some improvements to the GIS Manager but will hold off until
6.0 is released. Any word on when that will be?

Next week?

It would be nice to get v.surf.rst (2x #2990) and missing opt->key_desc
bugs (#3002) fixed first.

http://intevation.de/rt/webrt?serial_num=2990

I could not reproduce this one - it looks like the user gave invalid combination of options -
the z given both as a z-coordinate (layer=0) and as an attribute zcolumn=ELEV,
however, I tried it with one of my data sets and it behaved correctly even with this mix of options
(it either ignores zcolumn or ends with error message Vector is not 3D).
So I am suspicious that the users data set may have a problem. If somebody can reproduce it
I can try to fix it - the program ends because for a given segment it cannot find any points
within the segment or its neighborhood (the segmentation may be broken).

As for the GUI - it indeed gives an error message - Michael, is this something that you could fix?

Helena

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

This error is erratic. The most consistent way I've been able to reproduce
it and get v.surf.rst to work is the following:

Start GRASS
Run v.surf.rst from the menu
V.surf.rst fails

Quite GIS Manager but not GRASS
Restart GIS Manager (i.e., run d.m & from the command prompt)
Run v.surf.rst from the menu
V.surf.rst starts

It seems to choke on the line:

Authors: original version - H.Mitasova, L.Mitas, I. Kosinovsky, D.P. Gerdes
See manual pages for reference and publications

This kind of output regularly causes programs called from the tcltk menus to
fail. I've futzed with it a bit and can't get it to run consistently. Can
you perhaps not have it try to display this to the xterm? It ought to run OK
then.

I went ahead and fixed the other bugs Hamish noted in the menus. I'll try to
get them committed tomorrow. I'll try to see if there is anything else I can
try with v.surf.rst.

Michael
____________________
C. Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
PO Box 872402
Arizona State University
Tempe, AZ 85287-2402
USA

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

From: Helena <hmitaso@unity.ncsu.edu>
Organization: NCSU
Date: Tue, 15 Feb 2005 23:59:29 -0500
To: Hamish <hamish_nospam@yahoo.com>
Cc: Radim Blazek <blazek@itc.it>, <michael.barton@asu.edu>,
<grass5@grass.itc.it>
Subject: Re: [GRASS5] fixed 2 bugs in GIS Manager GRASS 6

Hamish wrote:

I just fixed 2 bugs in the GIS Manager for GRASS 6 that prevented
r.terraflow and d.colors from operating via the menus. I looked on
the bugtracker system to report them fixed but either a) I was
unable to properly search for them or b) neither was reported via
the bugtracker.

I have some improvements to the GIS Manager but will hold off until
6.0 is released. Any word on when that will be?

Next week?

It would be nice to get v.surf.rst (2x #2990) and missing opt->key_desc
bugs (#3002) fixed first.

http://intevation.de/rt/webrt?serial_num=2990

I could not reproduce this one - it looks like the user gave invalid
combination of options -
the z given both as a z-coordinate (layer=0) and as an attribute zcolumn=ELEV,
however, I tried it with one of my data sets and it behaved correctly even
with this mix of options
(it either ignores zcolumn or ends with error message Vector is not 3D).
So I am suspicious that the users data set may have a problem. If somebody can
reproduce it
I can try to fix it - the program ends because for a given segment it cannot
find any points
within the segment or its neighborhood (the segmentation may be broken).

As for the GUI - it indeed gives an error message - Michael, is this something
that you could fix?

Helena

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

On Wed, 16 Feb 2005, Michael Barton wrote:

This error is erratic. The most consistent way I've been able to reproduce
it and get v.surf.rst to work is the following:

[...]

It seems to choke on the line:

Authors: original version - H.Mitasova, L.Mitas, I. Kosinovsky, D.P. Gerdes
See manual pages for reference and publications

This kind of output regularly causes programs called from the tcltk menus to
fail. I've futzed with it a bit and can't get it to run consistently. Can
you perhaps not have it try to display this to the xterm? It ought to run OK
then.

Just a guess but perhaps in some places it writes to stdout and others to stderr? IMHO for messages like that that aren't part of the GIS-related output of the module, it should always be stderr: see http://grass.itc.it/pipermail/grass5/2004-October/015720.html

Paul

Paul Kelly wrote:

On Wed, 16 Feb 2005, Michael Barton wrote:

> This error is erratic. The most consistent way I've been able to reproduce
> it and get v.surf.rst to work is the following:
>
[...]
>
> It seems to choke on the line:
>
> Authors: original version - H.Mitasova, L.Mitas, I. Kosinovsky, D.P. Gerdes
> See manual pages for reference and publications
>
> This kind of output regularly causes programs called from the tcltk menus to
> fail. I've futzed with it a bit and can't get it to run consistently. Can
> you perhaps not have it try to display this to the xterm? It ought to run OK
> then.

I have completely removed that line and it still gives the same error

GRASS 6.0.cvs:~/grasscvs6/grass6/vector/v.surf.rst >
ERROR: Required parameter <input> not set:
    (Name of the vector file with input data).

Helena
                                                                                                                               
Description:
Interpolation and topographic analysis from given point or contour data
in vector format to GRASS floating point raster format using regularized
spline with tension.

Just a guess but perhaps in some places it writes to stdout and others to
stderr? IMHO for messages like that that aren't part of the GIS-related
output of the module, it should always be stderr: see
http://grass.itc.it/pipermail/grass5/2004-October/015720.html

Paul

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

Helena and others,

This program (not the version that Helena just fixed) is launching fine from
the menus on my desktop G5. It was launching erratically on my PowerBook
last night. On my PowerBook, it wants to print all the help text to the
terminal when I launch it. This is not happening on my desktop. Why? I have
absolutely no idea.

I think that Paul is on the right track, but there may be more to it than
just the author citation. It should only print the usage/man page
information from the command line with the -h switch. There is an
undocumented gui flag that Glynn has described but that I can't find at the
moment and I can't remember what it does. This might help (I'm a big help,
yes?). At the moment, I'll keep the menu entry calling v.surf.rst as it is
because I can't see changing it has any useful effects. However, if we can
get some kind of consistent--proper--behavior I'll update the menu as needed
to do this.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Helena Mitasova <hmitaso@unity.ncsu.edu>
Date: Wed, 16 Feb 2005 10:53:52 -0500
To: Paul Kelly <paul-grass@stjohnspoint.co.uk>
Cc: Michael Barton <michael.barton@asu.edu>, Hamish <hamish_nospam@yahoo.com>,
<grass5@grass.itc.it>
Subject: Re: [GRASS5] fixed 2 bugs in GIS Manager GRASS 6

Paul Kelly wrote:

On Wed, 16 Feb 2005, Michael Barton wrote:

This error is erratic. The most consistent way I've been able to reproduce
it and get v.surf.rst to work is the following:

[...]

It seems to choke on the line:

Authors: original version - H.Mitasova, L.Mitas, I. Kosinovsky, D.P. Gerdes
See manual pages for reference and publications

This kind of output regularly causes programs called from the tcltk menus to
fail. I've futzed with it a bit and can't get it to run consistently. Can
you perhaps not have it try to display this to the xterm? It ought to run OK
then.

I have completely removed that line and it still gives the same error

GRASS 6.0.cvs:~/grasscvs6/grass6/vector/v.surf.rst >
ERROR: Required parameter <input> not set:
    (Name of the vector file with input data).

Helena
                 
Description:
Interpolation and topographic analysis from given point or contour data
in vector format to GRASS floating point raster format using regularized
spline with tension.

Just a guess but perhaps in some places it writes to stdout and others to
stderr? IMHO for messages like that that aren't part of the GIS-related
output of the module, it should always be stderr: see
http://grass.itc.it/pipermail/grass5/2004-October/015720.html

Paul

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

It looks like it is trying to run the program BEFORE opening the
interface
that allows the user to give it the input file and other required
options - so it gives an error that it does not have input and then
displays the usage information - which is a correct behavior
(grass programs display usage if there is an error on command line).
So is there a way how to make it display the interface first, let the
user
type/select the input and other parameters and then run it?
I removed all stdout stuff from the program and it does not make a
difference.
Michael do you have the latest update of grass6 cvs on your desktop
where
the command starts correctly? If it is an older version I can try to
track any changes
that were made and see whether that would help.
The program runs fine on the command line.

Helena

Michael Barton wrote:

Helena and others,

This program (not the version that Helena just fixed) is launching fine from
the menus on my desktop G5. It was launching erratically on my PowerBook
last night. On my PowerBook, it wants to print all the help text to the
terminal when I launch it. This is not happening on my desktop. Why? I have
absolutely no idea.

I think that Paul is on the right track, but there may be more to it than
just the author citation. It should only print the usage/man page
information from the command line with the -h switch. There is an
undocumented gui flag that Glynn has described but that I can't find at the
moment and I can't remember what it does. This might help (I'm a big help,
yes?). At the moment, I'll keep the menu entry calling v.surf.rst as it is
because I can't see changing it has any useful effects. However, if we can
get some kind of consistent--proper--behavior I'll update the menu as needed
to do this.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

> From: Helena Mitasova <hmitaso@unity.ncsu.edu>
> Date: Wed, 16 Feb 2005 10:53:52 -0500
> To: Paul Kelly <paul-grass@stjohnspoint.co.uk>
> Cc: Michael Barton <michael.barton@asu.edu>, Hamish <hamish_nospam@yahoo.com>,
> <grass5@grass.itc.it>
> Subject: Re: [GRASS5] fixed 2 bugs in GIS Manager GRASS 6
>
> Paul Kelly wrote:
>>
>> On Wed, 16 Feb 2005, Michael Barton wrote:
>>
>>> This error is erratic. The most consistent way I've been able to reproduce
>>> it and get v.surf.rst to work is the following:
>>>
>> [...]
>>>
>>> It seems to choke on the line:
>>>
>>> Authors: original version - H.Mitasova, L.Mitas, I. Kosinovsky, D.P. Gerdes
>>> See manual pages for reference and publications
>>>
>>> This kind of output regularly causes programs called from the tcltk menus to
>>> fail. I've futzed with it a bit and can't get it to run consistently. Can
>>> you perhaps not have it try to display this to the xterm? It ought to run OK
>>> then.
>
> I have completely removed that line and it still gives the same error
>
> GRASS 6.0.cvs:~/grasscvs6/grass6/vector/v.surf.rst >
> ERROR: Required parameter <input> not set:
> (Name of the vector file with input data).
>
> Helena
>
> Description:
> Interpolation and topographic analysis from given point or contour data
> in vector format to GRASS floating point raster format using regularized
> spline with tension.
>
>>
>> Just a guess but perhaps in some places it writes to stdout and others to
>> stderr? IMHO for messages like that that aren't part of the GIS-related
>> output of the module, it should always be stderr: see
>> http://grass.itc.it/pipermail/grass5/2004-October/015720.html
>>
>> Paul
>>
>> _______________________________________________
>> grass5 mailing list
>> grass5@grass.itc.it
>> http://grass.itc.it/mailman/listinfo/grass5

I was mistaken about it starting up correctly on my desktop. I am getting
the same behavior as on my laptop. Sorry.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Helena Mitasova <hmitaso@unity.ncsu.edu>
Date: Wed, 16 Feb 2005 12:06:15 -0500
To: Michael Barton <michael.barton@asu.edu>
Cc: Paul Kelly <paul-grass@stjohnspoint.co.uk>, Hamish
<hamish_nospam@yahoo.com>, <grass5@grass.itc.it>
Subject: Re: [GRASS5] fixed 2 bugs in GIS Manager GRASS 6

It looks like it is trying to run the program BEFORE opening the
interface
that allows the user to give it the input file and other required
options - so it gives an error that it does not have input and then
displays the usage information - which is a correct behavior
(grass programs display usage if there is an error on command line).
So is there a way how to make it display the interface first, let the
user
type/select the input and other parameters and then run it?
I removed all stdout stuff from the program and it does not make a
difference.
Michael do you have the latest update of grass6 cvs on your desktop
where
the command starts correctly? If it is an older version I can try to
track any changes
that were made and see whether that would help.
The program runs fine on the command line.

Helena

Michael Barton wrote:

Helena and others,

This program (not the version that Helena just fixed) is launching fine from
the menus on my desktop G5. It was launching erratically on my PowerBook
last night. On my PowerBook, it wants to print all the help text to the
terminal when I launch it. This is not happening on my desktop. Why? I have
absolutely no idea.

I think that Paul is on the right track, but there may be more to it than
just the author citation. It should only print the usage/man page
information from the command line with the -h switch. There is an
undocumented gui flag that Glynn has described but that I can't find at the
moment and I can't remember what it does. This might help (I'm a big help,
yes?). At the moment, I'll keep the menu entry calling v.surf.rst as it is
because I can't see changing it has any useful effects. However, if we can
get some kind of consistent--proper--behavior I'll update the menu as needed
to do this.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Helena Mitasova <hmitaso@unity.ncsu.edu>
Date: Wed, 16 Feb 2005 10:53:52 -0500
To: Paul Kelly <paul-grass@stjohnspoint.co.uk>
Cc: Michael Barton <michael.barton@asu.edu>, Hamish
<hamish_nospam@yahoo.com>,
<grass5@grass.itc.it>
Subject: Re: [GRASS5] fixed 2 bugs in GIS Manager GRASS 6

Paul Kelly wrote:

On Wed, 16 Feb 2005, Michael Barton wrote:

This error is erratic. The most consistent way I've been able to reproduce
it and get v.surf.rst to work is the following:

[...]

It seems to choke on the line:

Authors: original version - H.Mitasova, L.Mitas, I. Kosinovsky, D.P.
Gerdes
See manual pages for reference and publications

This kind of output regularly causes programs called from the tcltk menus
to
fail. I've futzed with it a bit and can't get it to run consistently. Can
you perhaps not have it try to display this to the xterm? It ought to run
OK
then.

I have completely removed that line and it still gives the same error

GRASS 6.0.cvs:~/grasscvs6/grass6/vector/v.surf.rst >
ERROR: Required parameter <input> not set:
    (Name of the vector file with input data).

Helena

Description:
Interpolation and topographic analysis from given point or contour data
in vector format to GRASS floating point raster format using regularized
spline with tension.

Just a guess but perhaps in some places it writes to stdout and others to
stderr? IMHO for messages like that that aren't part of the GIS-related
output of the module, it should always be stderr: see
http://grass.itc.it/pipermail/grass5/2004-October/015720.html

Paul

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

I think that Paul is on the right track, but there may be more to it
than just the author citation.

Output needs to wait until G_parser() has been called.

After moving the fprintf()s it launches the GUI correctly for me from
the d.m menus.

I haven't tested it any further though.

If it is still breaking for you, then perhaps the code that figures out
the default values of dmin/dmax needs to be moved further down/abondoned
too???

There is an undocumented gui flag that Glynn has described but that I
can't find at the moment and I can't remember what it does. This might
help (I'm a big help, yes?).

sure, --ui.

lib/gis/parser.c:

* If first arg is "help" give a usage/syntax message */
if (strcmp(argv[1],"help") == 0 ||
        strcmp(argv[1], "-help") == 0 ||
        strcmp(argv[1], "--help") == 0)
{
        G_usage();
        return -1;
}

/* If first arg is "--interface-description" then print out
* a xml description of the task */
if (strcmp(argv[1],"--interface-description") == 0)
{
        G_usage_xml();
        return -1;
}

/* If first arg is "--html-description" then print out
* a xml description of the task */
if (strcmp(argv[1],"--html-description") == 0)
{
        G_usage_html();
        return -1;
}

/* If first arg is "--ui" then run G_gui() */
if (strcmp(argv[1],"--ui") == 0)
{
        G_gui();
        return -1;
}

/* If first arg is "--tcltk" then then generate
* code for tcltkgrass */
if (strcmp(argv[1],"--tcltk") == 0)
{
        G_tcltk();
        exit(0);
}

At the moment, I'll keep the menu entry calling v.surf.rst as it is
because I can't see changing it has any useful effects.

I don't think it's the menu's fault (but I guess it should be called
with the "execute" command like everything else unless there is a reason
not to do so). Either G_parser() needs to be more robust at handling
unexepected input or we must be strict about putting nothing unexpected
before the G_parser() call in each module.

Hamish

I removed all stdout stuff from the program and it does not make a
difference.

are you sure make ran ok & the binary updated?

I've just tested it with the fprintf("Authors:")s moved to just after the
G_parser() call. It now works (for me) from the command line->GUI, from
the d.m menus, and from the command line with options.

dmin/dmax code left in place.

display/d.m/menu.tcl is using "execute" to run v.surf.rst.
no idea if that makes a difference.

spearfish57 dataset:
v.surf.rst in=bugsites elev=bug.rst zcolumn=cat

[Helena: -c never needed anyway as you can do zcolumn=cat ??
    why have a -v flag, why not just test for cvdev= option? ]

Hamish

It should be fixed now - moving the fprintf after G_parser actually did it,
but I have to close the GIS manager and re-open it by d.m - then v.surf.rst launched from GUI
works (don't ask me why). It also works from command line->GUI.
I will have to contact the user to ask about the data to see why there was a problem
on command line.

thanks for the advice,

Helena

I removed all stdout stuff from the program and it does not make a
difference.

are you sure make ran ok & the binary updated?

I've just tested it with the fprintf("Authors:")s moved to just after the
G_parser() call. It now works (for me) from the command line->GUI, from
the d.m menus, and from the command line with options.

dmin/dmax code left in place.

display/d.m/menu.tcl is using "execute" to run v.surf.rst.
no idea if that makes a difference.

spearfish57 dataset:
v.surf.rst in=bugsites elev=bug.rst zcolumn=cat

[Helena: -c never needed anyway as you can do zcolumn=cat ??
    why have a -v flag, why not just test for cvdev= option? ]

Hamish

Hamish wrote:

> I think that Paul is on the right track, but there may be more to it
> than just the author citation.

Output needs to wait until G_parser() has been called.

Yep. When the --ui switch is provided, nothing must be written to
stdout except the Tcl/Tk code which generates the UI.

I don't think it's the menu's fault (but I guess it should be called
with the "execute" command like everything else unless there is a reason
not to do so). Either G_parser() needs to be more robust at handling
unexepected input or we must be strict about putting nothing unexpected
before the G_parser() call in each module.

The latter. For --ui to work correctly, it's essential that the
program doesn't dump garbage into the Tcl/Tk code which --ui
generates.

Ditto for --html-description.

Modules *must* allow for these cases. You cannot assume that the
program is being executed "normally" until G_parser() has returned.

Modules shouldn't be calling anything except G_gisinit() and the
parser-initialisation stuff until G_parser() has returned. That
includes not connecting to monitors or databases, not accessing
$GISRC, nor the region, nor the mapset.

Yes, this means that you can't set "dynamic" defaults based upon any
of those factors. Tough; live with it. If you want dynamic defaults,
figure out the actual values *after* G_parser() returns.

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