[GRASS-user] d.vect: Setting Colors by Attribute Column

Hamish hamish_b at yahoo.com
Wed Dec 30 17:59:51 EST 2009


Hamish
> > v.colors column=mukey color=random
> > d.vect -a
Rich:
>    Unfortunately, mukey is alphanumeric
> rather than strictly numeric. I guess
> this means I need to build a lookup table, or modify the
> map attribute table itself. Ah, well.


ok, so v.colors should probably be extended.

as a hackish thought experiment, I wonder if you could do
v.to.rast ...
r.color color=random
 (then just d.rast directly, or)
parse the raster colr/ rules for use with 'v.colors rules='.

there may be some code in the r.out.gmt family of scripts to
help parse the colr/ file into something suitable for rules=.


or maybe v.db.select for the mukey column, |sort|uniq|nl, then
a loop of v.db.update (or if that is too slow make a SQL command
list to feed to db.execute in one go) to give each unique mukey
it's own lookup ID.


Hamish



      


More information about the grass-user mailing list