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

GRASS GIS trac at osgeo.org
Mon Aug 4 19:05:16 PDT 2014


#2382: d.legend: integer map legends should not be flipped upside-down
----------------------+-----------------------------------------------------
  Reporter:  neteler  |       Owner:  hamish             
      Type:  defect   |      Status:  closed             
  Priority:  normal   |   Milestone:  7.0.0              
 Component:  Display  |     Version:  svn-releasebranch70
Resolution:  wontfix  |    Keywords:  d.legend           
  Platform:  All      |         Cpu:  Unspecified        
----------------------+-----------------------------------------------------

Comment(by wenzeslaus):

 Replying to [comment:7 hamish]:
 > > "smoothed" legend != "gradient" legend
 >
 > Hi,
 >
 > I was thinking a bit more about this, maybe a way around the ambiguity
 of what kind of data a CELL map contains is for d.legend to test if the
 `r.support units=` has been set and has a string length > 0, and if it
 contains a value assume it is a continuous gradient map, and so smallest
 value on the bottom.
 >
 This is using map metadata to decide what map means. I quite like it.

 > I fear it moves a bit into 'too tricky for its own good' territory, the
 existing help text is nicely concise, but apparently what to expect is not
 obvious if you haven't read that. I guess since it talks about
 "categorical" and not CELL maps, the text wouldn't have to change for a
 continuous gradient CELL map? Seems a bit of a stretch & I don't want to
 introduce more confusion..

 >        Raster maps based on  floating  point  values  will
 >        display  smoothed, from greatest to smallest value,
 >        while categorical raster maps will display in order,
 >        from  top to bottom. Horizontal legends will always
 >        be smoothed. If the box is defined with inverted y-
 >        values  or an inverted range, the legend will auto-
 >        matically flip. If this is not the desired  result,
 >        the -f flag may be used to flip it back.
 >

 I think that the requirement is that that the default behavior must be the
 most expected thing. Getting smoothed from bottom to top legend for
 floating point maps and for maps which have units and the opposite for
 categorical is the expected thing. It think that it is clear for us and it
 seems also that there is a way to implement it.

 However, there should always be a clear way to set what I want if I know
 what I want and I'm not sure if the mechanism behind giving expected
 behavior will work for me. I'm not sure if the interface is clear enough
 for this case. I'm thinking what if I have to program something which
 would be using `d.legend` how I will deal with change of legend just
 because of slight change of the size of the window.

 I never know if `-f` means "flip back if flipped", "flip from bottom-to-
 top to top-to-bottom" or "flip to the opposite of what the automatic
 mechanism would do". Again, I'm scared of having to program something
 which is using the inverted coordinates approach. Only the flipped range
 looks quite clear but why then I'm confused we need the other two?

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



More information about the grass-dev mailing list