[GRASS-dev] Re: Problem when loading GRASS 6 raster with large integer values into R via r.out.bin

Rainer M Krug r.m.krug at gmail.com
Wed Sep 24 06:09:37 EDT 2008


On Wed, Sep 24, 2008 at 11:32 AM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
> On Wed, 24 Sep 2008, Rainer M Krug wrote:
>
>> On Wed, Sep 24, 2008 at 4:45 AM, Hamish <hamish_b at yahoo.com> wrote:
>>>>>
>>>>> Concerning trapping of the verbose messages, I think it would be a
>>>>> good idea to do the following:
>>>>>
>>>>> 1) add a parameter verbose=TRUE in readRAST6 and writeRAST6 to enable
>>>>> or disable it
>>>
>>> Roger:
>>>>
>>>> I'll try to do this using the existing ignore.stderr= in system(), but
>>>> it may not stop everything.
>>>
>>> When possible it should utilize the --quiet and --verbose flags which all
>>> GRASS modules listen for, or set the GRASS_VERBOSE environment variable
>>> to the required level. Blindly throwing all stderr messages to /dev/null
>>> should be a last resort, there may be something important there.
>>
>> I think that's a good idea - to use the same standard flags that GRASS
>> is also using (including the --overwrite which would be nice to have
>> in the writeRAST6 by the way).
>> I will keep that approach in mind for other commands interfacing to GRASS.
>
> Yes in principle, but do we know whether users are still on 6.2, or have
> migrated to 6.3 and there is no further need to condition on feature creep?
> Remember that the R/GRASS interface isn't GRASS, it's an interface. I can
> look at reading the GRASS_VERBOSE shell variable and using it to set
> verbosity if present. The -q versus --q change killed the tests/examples
> when it happened, so I'd prefer conservatism (do nothing) to using GRASS
> facilities that vary between GRASS versions.

Agreed - that's a good point.
I don't think it is a good idea to use the GRASS_VERBOSE variable,
unless you provide a function to set (and unset) it from R - then it
could be used - but I would prefer an approach where the R function
has an argument specifying if it should be verbose or not, and quiet
or not. For a GRASS user it would be an advantage to have its named
after the GRASS flag, i.e verbose=TRUE would provide the output of the
GRASS module (with --verbose) to stderr. verbose=FALSE would not - but
you could still keep the --verbose flag and discard the output from
GRASS.

Rainer
>
> Roger
>
>>
>> Rainer
>>
>>
>>>
>>>
>>> Hamish
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> grass-dev mailing list
>>> grass-dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/grass-dev
>>>
>>
>>
>>
>>
>
> --
> 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
>
>



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Faculty of Science
Natural Sciences Building
Private Bag X1
University of Stellenbosch
Matieland 7602
South Africa


More information about the grass-dev mailing list