[GRASS-dev] [GRASS GIS] #3311: Mismatch between CLI and GUI for r.colors using external rules file

#3311: Mismatch between CLI and GUI for r.colors using external rules file
-------------------------+-------------------------
Reporter: madi | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.2.1
Component: Raster | Version: svn-trunk
Keywords: r.colors | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
There is a mismatch between the command line and the GUI of r.colors when
providing an external file for color rules. Via command line the correct
(working) command is:

{{{
r.colors map=map_name rules=rules.file
}}}

but via GUI, browsing the rules.file, it will build the following command:

{{{
r.colors map=map_name file=rules.file
}}}

throwing an error like:

{{{
Usage:
  r.colors [-rwlngae] [map=name[,name,...]] [file=name]
[color=style]
    [raster=name] [raster_3d=name] [rules=name] [--help]
[--verbose]
    [--quiet] [--ui]
Flags:
   -r Remove existing color table
   -w Only write new color table if it does not already
exist
   -l List available rules then exit
   -n Invert colors
   -g Logarithmic scaling
   -a Logarithmic-absolute scaling
   -e Histogram equalization
Parameters:
         map Name of raster map(s)
        file Input file with one map name per line
       color Name of color table
               options:
aspect,aspectcolr,bcyr,bgyr,blues,byg,byr,celsius,
corine,curvature,differences,elevation,etopo2,evi,
fahrenheit,gdd,grass,greens,grey,grey.eq,grey.log,
grey1.0,grey255,gyr,haxby,kelvin,ndvi,ndwi,oranges,
population,population_dens,precipitation,
precipitation_daily,precipitation_monthly,rainbow,
ramp,random,reds,roygbiv,rstcurv,ryb,ryg,sepia,slope,
soilmoisture,srtm,srtm_plus,terrain,viridis,water,wave
      raster Raster map from which to copy color table
   raster_3d 3D raster map from which to copy color table
       rules Path to rules file
ERROR: Options <map>, <file> and <-l> are mutually exclusive
ERROR: At least one of the following options is required:
<raster>, <raster_3d>, <color>, <rules>, <-r> and <-l>
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3311&gt;
GRASS GIS <https://grass.osgeo.org>

#3311: Mismatch between CLI and GUI for r.colors using external rules file
--------------------------+-------------------------
  Reporter: madi | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.1
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by hellik):

Replying to [ticket:3311 madi]:
> There is a mismatch between the command line and the GUI of r.colors
when providing an external file for color rules. Via command line the
correct (working) command is:
>
> {{{
> r.colors map=map_name rules=rules.file
> }}}
>
> but via GUI, browsing the rules.file, it will build the following
command:
>
> {{{
> r.colors map=map_name file=rules.file
> }}}

here with the GUI the command expands to:

{{{
r.colors map=myslope@user1 rules=D:\temp\test_c_rule.file
}}}

it works

tested with

{{{
System Info
GRASS version: 7.3.svn
GRASS SVN revision: r70733M
Build date: 2017-03-07
Build platform: x86_64-w64-mingw32
GDAL: 2.1.2
PROJ.4: 4.9.3
GEOS: 3.5.0
SQLite: 3.14.1
Python: 2.7.5
wxPython: 2.8.12.1
Platform: Windows-8-6.2.9200 (OSGeo4W)
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3311#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3311: Mismatch between CLI and GUI for r.colors using external rules file
--------------------------+-------------------------
  Reporter: madi | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.1
Component: Raster | Version: svn-trunk
Resolution: | Keywords: r.colors
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by hellik):

Replying to [ticket:3311 madi]:
> There is a mismatch between the command line and the GUI of r.colors
when providing an external file for color rules. Via command line the
correct (working) command is:
>
> {{{
> r.colors map=map_name rules=rules.file
> }}}
>
> but via GUI, browsing the rules.file, it will build the following
command:
>
> {{{
> r.colors map=map_name file=rules.file
> }}}
>

taken from the manual:

{{{
file=name
     Input file with one map name per line
     Input map names can be defined in an input file in case a large amount
of maps must be specified. This option is mutual exclusive to the map
option.
}}}

''file'' is on the first r.colors-GUI-tab, rules is on the second r
.colors-GUI-tab.

I would say it works normal. :wink:

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3311#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3311: Mismatch between CLI and GUI for r.colors using external rules file
--------------------------+-------------------------
  Reporter: madi | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.2.1
Component: Raster | Version: svn-trunk
Resolution: invalid | Keywords: r.colors
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by madi):

* status: new => closed
* resolution: => invalid

Comment:

You're right. Sorry for the noise

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3311#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>