[GRASS-dev] Re: [GRASS GIS] #739: v.mkgrid parameter needs two
values but is multiple=NO
GRASS GIS
trac at osgeo.org
Wed Sep 2 04:06:29 EDT 2009
#739: v.mkgrid parameter needs two values but is multiple=NO
--------------------------+-------------------------------------------------
Reporter: rsbivand | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: | Keywords: v.mkgrid
Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by hamish):
* keywords: => v.mkgrid
Comment:
Roger wrote: (please reply in-ticket)
{{{
The problem is that the GRASS parser adopts an illogical
view of multiple=NO, and overrides it when there is a comma
in keydesc. This means that I am obliged to make parseGRASS()
even more byzantine than before, to admit multiple integers
and floats where multiple=NO and the length of the R object
of the correct storage mode is > 1 (strings can be obfuscated
in the way you suggest). I'll try to mimic the IMHO very bad
behaviour of the parser.
Couldn't multiple take values YES, NO, or the integer count
required if the count is known, as here? multiple=2 would be
easy to parse.
Repeating, the 6.4 wxpython menu entry Vector -> Generate
grid is broken for me 6.4.0svn, but not current, because the
widget for entering grid only accepts a single integer (as per
--interface-description).
In current 6.4.0svn the widget has been changed to a text
widget, so that's why it works, but does not check for integer:
v.mkgrid --overwrite map=grd at rsb grid=99.3de,101.5abc
also runs, probably by rounding to integer.
I'll try to work around the parsing muddle, but will check
that the values given are both integer.
Roger
}}}
It's not illogical; it's just unintuitive in the wxGUI as some critical
information is not being displayed.
It should take it's cue from both opt->key_desc and opt->multiple.
e.g. r.what with multiple=YES has east_north=x1,y1[,x2,y2[,,...]]
if you give 3 values it complains that it wants a multiple of two.
or d.legend opt7->key_desc = "bottom,top,left,right"; but there
multiple sets of four = NO;
this works quite well in the C parser.
you are right, in the wxGUI for v.mkgrid it gives you no indication
that you should do "rows,columns" for the required grid option. It just
says (grid, integer)
In the tcltk GUI you get a bit more info:
(grid, rows,columns, required)
coor= is perhaps a more obvious example.
(coor, x,y, optional)
the help page, --help USAGE is the best:
grid=rows,columns [coor=x,y]
grid=rows,columns
Number of rows and columns in grid
that the parser doesn't check by type as well as it could is another issue
for another ticket.
Hamish
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/739#comment:3>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list