[GRASS-dev] [GRASS GIS] #89: d.legend: option to get info from stdin instead of raster

#89: d.legend: option to get info from stdin instead of raster
-------------------------+--------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: minor | Milestone: 6.4.0
Component: default | Version: unspecified
Keywords: |
-------------------------+--------------------------------------------------
this was code wish # 391 over on the old gforge tracker. moving it here.
http://wald.intevation.org/tracker/index.php?func=detail&aid=391&group_id=21&atid=188

Hamish

----

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. [see v.colors addon script]

If data is fed from stdin (signaled by map=-) create categorical legend
using that data. Data format: "cat|label|color"

e.g.
{{{
d.legend -m map="-" <<EOF
1|Main Street|255:0:0
2|Elm Street|0:255:0
3|Old Coach Road|0:0:255
EOF
}}}

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.

see expanded thread on the -dev mailing list:
  http://thread.gmane.org/gmane.comp.gis.grass.devel/19852/focus=19952

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/89&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

GRASS GIS wrote:

#89: d.legend: option to get info from stdin instead of raster
-------------------------+--------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: minor | Milestone: 6.4.0
Component: default | Version: unspecified
Keywords: |
-------------------------+--------------------------------------------------
this was code wish # 391 over on the old gforge tracker. moving it here.
http://wald.intevation.org/tracker/index.php?func=detail&aid=391&group_id=21&atid=188

Hamish

----

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. [see v.colors addon script]

The basic idea is reasonable enough, but:

1. The map= option shouldn't be (ab)used for that purpose. There
should be separate options instead. Apart from anything else, you
either have to change map->gisprompt to allow something which isn't a
map (which means that you don't get the map browser in the GUI), or
you leave map->gisprompt alone but then can't use that feature from
the GUI.

2. Using stdin is generally a bad idea. It doesn't work with the GUI.
The module needs to copy the data to a temporary file so that d.save,
d.redraw etc work.

--
Glynn Clements <glynn@gclements.plus.com>

#89: d.legend: option to get info from stdin instead of raster
--------------------------+-------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: minor | Milestone: 6.5.0
Component: Display | Version: unspecified
Resolution: | Keywords: d.legend
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by hamish):

  * keywords: => d.legend
  * platform: => Unspecified
  * component: default => Display
  * cpu: => Unspecified
  * milestone: 6.4.0 => 6.5.0

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