[GRASS-dev] [GRASS GIS] #3077: r.colors: flag to output color table type and value range

GRASS GIS trac at osgeo.org
Mon Jun 27 08:57:30 PDT 2016


#3077: r.colors: flag to output color table type and value range
--------------------------+---------------------------------------------
  Reporter:  neteler      |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:  7.2.0
 Component:  Raster       |    Version:  svn-trunk
Resolution:               |   Keywords:  r.colors, gsoc2016, cartography
       CPU:  All          |   Platform:  All
--------------------------+---------------------------------------------
Changes (by wenzeslaus):

 * keywords:  r.colors, gsoc2016 => r.colors, gsoc2016, cartography


Comment:

 [source:grass/trunk/lib/gis/colors.desc lib/gis/colors.desc] could be
 somehow improved during compilation or we can do some updates in the C
 code and just do it on the fly (creating some overhead). The string in the
 manual is now created in [source:grass/trunk/lib/gis/parser_html.c
 lib/gis/parser_html.c] from name and description which are prepared by
 `G_color_rules_descriptions()` in
 [source:grass/trunk/lib/gis/color_rules.c lib/gis/color_rules.c]. This
 function could read the actual file and put the info to the string. Min
 and max could be done by string replacement in the text to provide way to
 include those into the text and ''relative''/''absolute'' (and perhaps
 ''combined'') can be at the end of the description ("out of the
 sentence"). For example, the `colors.desc` file would have this:

 {{{
 precipitation: precipitation color table ({min}..{max}mm)
 }}}

 Then the `G_color_rules_descriptions()` function would read the
 [source:grass/trunk/lib/gis/colors/precipitation precipitation] file and
 get 0 as min and 7000 as max and because there is no percent sign in the
 whole file, the color table type would be set to `absolute`. The resulting
 string for the color table `precipitation` would be:

 {{{
 precipitation;precipitation color table (0..7000mm) [absolute];
 }}}

 Related to that (but outside of scope), this does not solve the issue with
 translations of these descriptions (they are not translated). Also, the
 GUI currently doesn't show the descriptions well enough.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3077#comment:1>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list