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

Rich Shepard rshepard at appl-ecosys.com
Wed Dec 30 18:22:59 EST 2009


On Wed, 30 Dec 2009, Hamish wrote:

>> 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='.

   I'll give this a try.

> 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.

   I was going to address the dbms issue after clipping the vector and raster
DEM file and ensuring that they all display properly. I converted the .dbf
tables to SQLite, cleaned out the ESRI-specific cruft I don't need, and
imported all tables into a single database. Don't yet know if that's the
GRASS-approved approach, but I'm not yet there to work on it. :-)

Thanks,

Rich



More information about the grass-user mailing list