[GRASS-dev] [GRASS GIS] #3014: Add ticks to continuous raster legend

GRASS GIS trac at osgeo.org
Sat Jun 11 14:32:15 PDT 2016


#3014: Add ticks to continuous raster legend
--------------------------+---------------------------------------------
  Reporter:  annakrat     |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:  7.3.0
 Component:  Display      |    Version:  svn-trunk
Resolution:               |   Keywords:  d.legend, gsoc2016, cartography
       CPU:  Unspecified  |   Platform:  All
--------------------------+---------------------------------------------

Comment (by lazaa):

 I uploaded new patch and I added several new options. Option {{{title}}}
 to define custom title to display on the top of the legend.
 {{{
 d.legend raster=srtm title="Map legend"
 }}}
 An option {{{tick_value}}} to specify values where the ticks and labels
 will be displayed. Option {{{labelnum}}} is used to show only min and max.
 {{{
 d.legend raster=srtm labelnum=2 tick_value=1000,1848,2700,3500
 }}}
 Then option {{{step}}} to draw ticks and display labels at rounded values-
 values divisible by {{{step}}} value with rest 0. (Flag {{{-c}}} is used
 to hide labels generated from {{{labelnum}}} and to display only labels
 with defined interval.)
 {{{
 d.legend raster=srtm -c step=500
 }}}

 I've tested it for vertical/horizontal and normal/flipped legend it works
 fine. There's a problem with horizontal legend if user define more ticks
 then longer labels can overlap.

 More testing welcome.

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



More information about the grass-dev mailing list