[GRASSLIST:8231] Re: key column for categories

Hamish hamish_nospam at yahoo.com
Sat Sep 10 00:27:18 EDT 2005


> I imported a vector shapefile in Grass 6.0. The file contains some 70 
> different categories that are not explicitely written in a 'cat'
> column.

If importing with v.in.ascii you can use the cat= option to tell it
which column contains the category number.

>  while importing, grass put me an extra column 'cat' in the
> .dbf file which is  used as category (numbers from 1-...).
> I need to represent the different  categories in different colors with
> a legend, but grass uses this cat column  as key column. how do I
> change this to get my own categories represented in  different
> colors?

You can tell it to use another column with the v.reclass module's
column= option, or the same module to re-categorize by specified rules.

see also the d.vect -a flag for use with a column named GRASSRGB
containing RGB color triplets for each feature attribute.


> (do my categories have to be numbers or can they be text?)

They have to be numbers. Of course you can assign meaning to those
numbers yourself.


> A small hind on how to show the legend would be helpful too.

vector legends in GRASS:
 d.vect.thematic
 ps.map's vlegend instruction



Hamish




More information about the grass-user mailing list