[GRASS-dev] Re: [GRASS GIS] #739: v.mkgrid parameter needs two values but is multiple=NO

Roger Bivand Roger.Bivand at nhh.no
Wed Sep 2 03:21:52 EDT 2009


On Tue, 1 Sep 2009, Markus Neteler wrote:

> On Tue, Sep 1, 2009 at 9:50 PM, Roger Bivand<Roger.Bivand at nhh.no> wrote:
>> On Tue, 1 Sep 2009, GRASS GIS wrote:
>>
>>> #739: v.mkgrid parameter needs two values but is multiple=NO
> ...
>>> here you need to use
>>>
>>> ... grid=paste(as.integer(100), as.integer(100), sep=",")
>>
>> No,
>>
>>> execGRASS("v.mkgrid", flags="overwrite", parameters=list(map="grd",
>>>   grid=paste(as.integer(100), as.integer(100), sep=",")))
>>> Error in doGRASS(cmd, flags = flags, parameters = parameters) :
>>>  Parameter <grid> does not have integer value
>>
>> because doGRASS() checks the type, and with c(as.integer(100),
>>  as.integer(100)) would concatenate correctly with a comma.
>
> I see (if possible, could we have the debug output of R?).
>
>> The problem is in the wrong setting of grid->multiple as NO, which simply
>> isn't examined from the command line. The wxpython GUI version has exactly
>> the same problem.
>
> For me it works in GRASS 6.5 wxGUI, also in the (current) 6.4.svn.

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

>
> Markus
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no


More information about the grass-dev mailing list