[GRASS-dev] r.colors -help

Vaclav Petras wenzeslaus at gmail.com
Tue Mar 11 16:10:00 PDT 2014


On Tue, Mar 11, 2014 at 6:48 PM, Vaclav Petras <wenzeslaus at gmail.com> wrote:

>
>
>
>
>
>
> On Tue, Mar 11, 2014 at 9:40 AM, Alessandro Samuel Rosa <
> alessandrosamuel at yahoo.com.br> wrote:
>
>>  Dear Grass Developers,
>>
>> I am using GRASS from R with package spgrass6. There is an inconsistency
>> between some modules which I believe is not related with R or spgrass6.
>> Usually, calling a module without passing any arguments is the same as
>> using argument "-help". For example, system("r.carve") returns the same as
>> system("r.carve -help"). This is not true for "r.colors". When calling
>> "r.colors" without the help argument, GRASS returns an error message
>> informing that no raster map was specified.
>>
>
> I can confirm the inconsistency. I tested command line and ipython. In
> GRASS 7, r.colors returns 1 and prints error message. r.carve opens GUI,
> and g.region returns 0 and does nothing.
>
> {{{
> GRASS > r.colors
> ERROR: Options <map> or <file> must be specified
> GRASS > r.carve
> (GUI opens)
> GRASS > g.region
> (nothing happens)
> }}}
>
>
Fourth type are the modules where no parameters are valid, e.g. g.gisenv:

{{{
g.gisenv
DEBUG=0
LOCATION_NAME=grass_fire_demolocation
GISDBASE=/home/vasek/Documents/mea582/project/grassdata
MAPSET=vasek
GUI=wxpython
}}}

The consistency is achieved in wxGUI Command line where every module
without parameters causes the dialog to be open. This is nicely hides the
inconsistency between r.color, r.carve, and g.region but unfortunately, it
prevents g.gisenv from running. The workaround is to use the `-n` flag in
this case.

{{{
> In [1]: import grass.script.core as gcore
>
> In [2]: gcore.run_command('r.colors')
> ERROR: Options <map> or <file> must be specified
> Out[2]: 1
>
> In [3]: gcore.run_command('r.carve')
> (GUI opens)
>
> In [4]: gcore.run_command('g.region')
> Out[4]: 0
> }}}
>
> If I not wrong, there is another module that I used sometime ago which has
>> the same behaviour, but I can not remember which.
>>
>
> These can apply to modules which has mandatory argument but there are two
> to choose from such as `file` and `map` in case of r.colors.
>
>>
>> I suggest that, if possible, the help of any module could be called
>> simply passing the module name without further arguments.
>>
>> Regards,
>>
>>
>>   --
>>
>> Alessandro Samuel-Rosa
>> ---
>> PhD Candidate Graduate School in Agronomy - Soil Science
>> Federal Rural University of Rio de Janeiro
>> Seropédica, Rio de Janeiro, Brazil
>> ---
>> Guest Researcher ISRIC - World Soil Information
>> Wageningen, the Netherlands alessandro.rosa at wur.nl | Phone 0031 06 4435
>> 9563
>> ---
>> Homepage: soil-scientist.net Skype: alessandrosamuel
>>
>>
>>
>> _______________________________________________
>> grass-dev mailing list
>> grass-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140311/c1ceb15f/attachment.html>


More information about the grass-dev mailing list