[GRASS-dev] [GRASS GIS] #2143: d.legend: add option to output legend definition as text

GRASS GIS trac at osgeo.org
Fri Feb 7 21:41:30 PST 2014


#2143: d.legend: add option to output legend definition as text
-----------------------------------+----------------------------------------
 Reporter:  wenzeslaus             |       Owner:  grass-dev@…              
     Type:  enhancement            |      Status:  new                      
 Priority:  trivial                |   Milestone:  7.0.0                    
Component:  Display                |     Version:  svn-trunk                
 Keywords:  d.legend, text output  |    Platform:  All                      
      Cpu:  All                    |  
-----------------------------------+----------------------------------------

Comment(by hamish):

 > I was not testing these but it seems to me that I would end up
 > in re-implementing d.legend,

 do you mean merging those GMT,Mapserver,VTK output tasks into d.legend?
 or rewriting a new d.legend from scratch?

 d.legend is for drawing objects on the screen.  r.colors.out & friends are
 for exporting color tables in ascii or other software's color table
 format, r.what.color and 'r.what -r' are two more modules that can help
 with that.

 the closest a d.* module conceptually comes to providing data output
 not display output is d.info or the interactive d.what.* modules.

 color table != legend rendering, and color table has its own management
 tools already.


 > e.g. when putting there labels

 ? I don't understand, d.legend already supports labels for categorical
 legends.

 the one thing it doesn't do currently is make adding data units text from
 r.support easy (ps.map can do that), so you have to use d.text instead.
 the code for that is easy, the hard part (and why I haven't done it yet)
 is deciding about the best placement.

 > or when forcing other types of legend than the map would use by default.

 can you provide an example? I'm not sure what you mean.



 The main part of the HTML driver is that it creates a html page with
 mouse-over hot-link zones, a less popular web feature now than back in the
 90s. I was just wondering aloud if it also had some rrr:ggg:bbb to #aabbcc
 conversion code in it, but that's trivial to reimplement so never mind.


 > > Do you have specific plans on how you'd use the output? or is this
 > > more a general idea?
 >
 > The motivation was the ability to create legend for HTML pages, or
 > alternatively LaTeX reports.

 so SVG and PostScript output, not rasterized output? (doing it as a small
 PNG file is already possible)  Don't the d.* + PNG/Cairo driver and ps.map
 + eps2{foo} already allow this? Some examples would help as I still don't
 understand what is wanted.

 > But the idea is general, e.g. font and generally handling of labels
 > could be important for any output which is trying to be something more
 than
 > an raster image.

 Do you mean arbitrary labels (d.labels and d.text) or the text which is
 drawn along with the legend itself? We already have some controls for that
 via d.font and enviro variables like GRASS_FONTSIZE and GRASS_FONT. Things
 that don't respect those arguably should, and wrapper scripts or custom
 GUI menus would allow them to be used from the GUI. What specifically is
 missing?

 n.b. putting those enviro variables in the library fns is problematic as
 you may want to do something complicated with d.text or d.grid using
 multiple font sizes or styles within the same module run.


 regards,
 Hamish

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



More information about the grass-dev mailing list