[GRASS-dev] d.menu, d.ask

Glynn Clements glynn at gclements.plus.com
Wed Mar 14 14:49:31 EDT 2007


Glynn Clements wrote:

> > arrows aren't critical;
> 
> It isn't whether they're critical. If they're even *useful*, I can add
> them easily enough (although it would be preferable if the aspect map
> was given as a command-line option, otherwise I need to add a map
> browser).

I've done this (the fact that the Tk canvas' line objects have a
-arrow option made it quite simple).

> > updated colors would be nice.
> 
> Right now, there doesn't appear to be any simple way to determine the
> colour for a specific category from outside of C.
> 
> The Tcl/Tk d.rast.edit gets the categories for the map being edited
> from r.out.ascii, and the colours from r.out.ppm. Thus, it knows the
> colour for each category (or FP value) which actually occurs in the
> original map.
> 
> If you decide to set a cell to a category which wasn't already in use,
> it has no idea what colour it should be, and (AFAICT) no simpler way
> to find out than:
> 
> 	$ r.mapcalc "$tempmap = $newval"
> 	$ r.colors $tempmap rast=$inmap
> 	$ r.out.ppm $tempmap out=$tempfile
> 	$ g.remove rast=$tempmap
> 
> 	% image create photo tempimg -file $tempfile
> 	% set rgb [tempimg get 0 0]
> 	% image delete tempimg
> 	% file delete $tempfile
> 
> Which is incredibly inefficient (and possibly error-prone).

In spite of that, I've added the above (with the enhancement that it
sets the region to 1x1 first), so previously-unused category should
also show the correct colour.

The major outstanding issue is whether d.rast.edit needs to be able to
pan around the map while it's running, or whether it's sufficient to
use a sequence of d.rast.edit commands interleaved with d.zoom or
g.region commands.

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




More information about the grass-dev mailing list