code R item #391, was opened at 2007-05-04 18:20
Status: Open
Priority: 3
Submitted By: Hamish Bowman (hamish)
Assigned to: Nobody (None)
Summary: d.legend: option to get info from stdin instead of raster
Issue status: None
GRASS component: display
Operating system: all
Operating system version:
Initial Comment:
Hi,
It would be nice if d.legend could look for "map=-" and if so take legend cat and color info from stdin. That way vector maps and custom legends could be made without resorting to tricks like making a dummy raster file to hold that info.
If data is fed from stdin (signaled by map=-) create categorical legend
using that data. Data format: "cat|label|color"
On 5/3/07 11:20 PM, "grass-coder@wald.intevation.org"
<grass-coder@wald.intevation.org> wrote:
Initial Comment:
Hi,
It would be nice if d.legend could look for "map=-" and if so take legend cat
and color info from stdin. That way vector maps and custom legends could be
made without resorting to tricks like making a dummy raster file to hold that
info.
If data is fed from stdin (signaled by map=-) create categorical legend
using that data. Data format: "cat|label|color"
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. I'm also having trouble trying to envision how it *could* work
in such a setting in order to make an alternative suggestion.
d.vect.chart [flag to send legend output to stdout] | d.legend map=- ???
Michael
In this way d.legend could work as a system module by the GUI instead of
a user module, and be useful for non-raster tasks too.
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
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=-
???
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.