[GRASS-dev] [GRASS GIS] #2382: d.legend: integer map legends should not be flipped upside-down

GRASS GIS trac at osgeo.org
Tue Jul 29 23:56:19 PDT 2014


#2382: d.legend: integer map legends should not be flipped upside-down
-------------------------+--------------------------------------------------
 Reporter:  neteler      |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  7.0.0                    
Component:  Display      |     Version:  svn-releasebranch70      
 Keywords:  d.legend     |    Platform:  All                      
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------
Changes (by hamish):

 * cc: grass-dev@… (added)


Comment:

 It is like that for CELL maps on purpose and working as designed; it's
 favouring categorical CELL maps over continuous value CELL maps.

 In the NC08 dataset consider: `d.legend towns`
  (see attached screenshot)

 I think we can all agree that counting from category 1 (smallest value) at
 the top is how we would like that to be.

 However, if there are more categories in the map than will fit on the
 display frame d.legend automatically switches to a smoothed gradient
 legend to avoid the user having to use the thin=, lines=, range=, or use=
 options to cut down the number of boxes it tries to draw.

 So it comes down to the question of is the data categorical (in which case
 smallest value is at the top) or continuous gradient which happens to be
 stored as integers (in which case smallest values is at the bottom). Since
 CELL maps can be used for both there is no single correct answer to that,
 and so the module goes with the logic that if the range of available cats
 or the frame size happens to change by a little bit, pushing it over the
 threshold, it will change the boxes into thin lines, but the overall view
 will remain the same, it has just gone into "compressed mode".


 note I built in two handy tricks to get the flip to happen without the -f
 flag: in GRASS 6 (and with at= in G7) when drawing the box with the mouse
 draw from bottom up instead of top down, and another way is to reverse the
 order of values in the range= option.


 regards,
 Hamish

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



More information about the grass-dev mailing list