Opened 8 years ago

Closed 8 years ago

#3311 closed defect (invalid)

Mismatch between CLI and GUI for r.colors using external rules file

Reported by: madi Owned by: grass-dev@…
Priority: normal Milestone: 7.2.1
Component: Raster Version: svn-trunk
Keywords: r.colors Cc:
CPU: Unspecified Platform: Unspecified

Description

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>

Change History (3)

in reply to:  description comment:1 by hellik, 8 years ago

Replying to 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) 

in reply to:  description comment:2 by hellik, 8 years ago

Replying to 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. ;-)

comment:3 by madi, 8 years ago

Resolution: invalid
Status: newclosed

You're right. Sorry for the noise

Note: See TracTickets for help on using tickets.