[GRASS-dev] [GRASS GIS] #2409: last call for options keys consolidation

GRASS GIS trac at osgeo.org
Sat Dec 27 20:00:30 PST 2014


#2409: last call for options keys consolidation
----------------------------------+-----------------------------------------
 Reporter:  martinl               |       Owner:  grass-dev@…              
     Type:  task                  |      Status:  new                      
 Priority:  blocker               |   Milestone:  7.0.0                    
Component:  Default               |     Version:  unspecified              
 Keywords:  standardized options  |    Platform:  Unspecified              
      Cpu:  Unspecified           |  
----------------------------------+-----------------------------------------

Comment(by wenzeslaus):

 Continuing in what I wrote in comment:17 and following ones changed
 G7:r.rgb in the way that fixed number of outputs handled by basename was
 replaced by specific options. This is not only more explicit but also fits
 more to the context when same rasters are used as input and in case of
 `r.rgb` allows to request only some outputs.

 Old `r.rgb`:

 {{{
 Usage:
  r.rgb input=name [output=basename] [--overwrite] [--help] [--verbose]
    [--quiet] [--ui]

 Parameters:
    input   Name of input raster map
   output   Name of output basename raster map(s)
             Default: input
 }}}

 New `r.rgb`:

 {{{
 Usage:
  r.rgb input=name red=name green=name blue=name [--overwrite]
    [--help] [--verbose] [--quiet] [--ui]

 Parameters:
   input   Name of input raster map
     red   Red channel raster map name
   green   Green channel raster map name
    blue   Blue channel raster map name
 }}}

 If somebody would like to learn how to write a test, this is a great
 opportunity. On might do something like:

 {{{
 r.composite r=lsat7_2002_10 g=lsat7_2002_30 b=lsat7_2002_50 o=lsat_comp
 r.rgb i=lsat_comp r=lsat7_2002_10 g=lsat7_2002_30 b=lsat7_2002_50
 }}}

 And then test difference of old and new maps. The results might not be
 identical but should be close to each other. Another tests can check if
 only one map is created when one map is requested.

 I cannot work on this more but similar change as I did for `r.rgb` could
 be done for G7:r.blend too. It also has an `output` option which is a
 "basename for red, green and blue output raster maps".

 There are some other modules I'm not completely sure about such as
 G7:i.pansharpen and G7:i.topo.corr.

 Some other seems that they don't need this change (e.g., G7:i.pca,
 G7:i.landsat.toar, G7:i.landsat.acca, and G7:i.tasscap) because the number
 of outputs is variable. However, I'm not sure how the suffixes are
 generated, sometimes it seems that they are even expected on the input.
 Standard basename separator (underscore, #2136) should be used in all
 cases otherwise it is not really standard, now many of them are probably
 using dot.

 Last issue I know about is G7:r.texture where the number of outputs
 depends on number of requested textures. G7:r.neighbors actually solves
 this issue by using output not as a basename but as multiple and
 requesting as many outputs as requested methods.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2409#comment:182>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list