[GRASS-dev] [grass-code R][391] d.legend: option to get info from stdin instead of raster

Hamish hamish_nospam at yahoo.com
Sun May 6 01:41:30 EDT 2007


http://wald.intevation.org/tracker/?func=detail&atid=188&aid=391&group_id=21
[copied from the wish ticket]


Michael Barton wrote:
> I'm overall in favor of d.legend being able to build a legend from
> such output. It would simplify matters for making thematic map and
> thematic chart legends and might even work for making vector legends.
> 
> However, the interactive format shown above wouldn't work in a
> scriptable GUI setting.

drop the -m and it uses default placement, or use "at=" --

> I'm also having trouble trying to envision how it *could* work in such
> a setting in order to make an alternative suggestion.

in the gui tool allow the user to draw a box. get the % of canvas coords
of two opposite corners and use them as "at=bottom,top,left,right".

 
> d.vect.chart [flag to send legend output to stdout] | d.legend map=-
> ????

yes, or 
  g.tempfile
  d.vect.chart -l > $TMPlegend
  d.legend map=- at=$B,$T,$L,$R < $TMPlegend

doing that in two steps with a temp file makes a bit more sense for use
within the d.vect.thematic script than the d.vect.chart example.

to survive redraw it might need to do command line replacement tricks
like d.text does. Getting it smooth will probably require a file= option
added to d.legend. But I'll wait until a stdin prototype is working and
see how that works in practice before worrying about that refinement.

FYI, this is a low priority for me right now, which is why I filed it as
a wish report, so it isn't lost.


Hamish




More information about the grass-dev mailing list