[GRASS-dev] [grass-code R][382] v.colors wish

grass-coder at wald.intevation.org grass-coder at wald.intevation.org
Wed Apr 25 16:35:36 EDT 2007


code R item #382, was opened at 2007-04-25 22:35
Status: Open
Priority: 3
Submitted By: Markus Neteler (markusn)
Assigned to: Nobody (None)
Summary: v.colors wish 
Issue status: None
GRASS component: vector
Operating system: all
Operating system version: 


Initial Comment:
A v.colors module (script?) is desired which helps to easily colorize
vector maps. 

v.colors vectormap column=name color=rulesfile

where
- column defines the column to use for colorization
- color defines a file to the list of attribute-color matches

The principal steps will be:

1. v.db.addcol vectormap col="GRASSRGB varchar(11)"

2. read color definition in the style
     attribute1 color1
     attribute2 color2
     ...

     with 
       - attributeX be existing attribute in specified column
       - colorX be color name (from X11 color list?) or RGB pattern

3. if needed, translate color names to RRR:GGG:BBB values

4. update attribute table column GRASSRGB
   loop over all lines in rulesfile, doing
      v.db.update vectormap col=GRASSRGB val="RRR:GGG:BBB" where="column=attributeX"

Maybe rather easy to do, some scripting...

Markus

----------------------------------------------------------------------

You can respond by visiting: 
http://wald.intevation.org/tracker/?func=detail&atid=188&aid=382&group_id=21




More information about the grass-dev mailing list